MCPcopy Create free account
hub / github.com/NVIDIA/cuda-samples / _initialize

Method _initialize

cpp/5_Domain_Specific/smokeParticles/ParticleSystem.cpp:80–100  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

78}
79
80void ParticleSystem::_initialize(int numParticles, bool bUseGL)
81{
82 assert(!m_bInitialized);
83
84 createNoiseTexture(64, 64, 64);
85
86 m_numParticles = numParticles;
87
88 // allocate GPU arrays
89 m_pos.alloc(m_numParticles, m_bUseVBO, true); // create as VBO
90 m_vel.alloc(m_numParticles, m_bUseVBO, true);
91
92 m_sortKeys.alloc(m_numParticles);
93 m_indices.alloc(m_numParticles, m_bUseVBO, false,
94 true); // create as index buffer
95
96 sdkCreateTimer(&m_timer);
97 setParameters(&m_params);
98
99 m_bInitialized = true;
100}
101
102void ParticleSystem::_free() { assert(m_bInitialized); }
103

Callers

nothing calls this directly

Calls 2

sdkCreateTimerFunction · 0.85
allocMethod · 0.80

Tested by

no test coverage detected