I’m trying to reorganize my program, and I’m having a bit of difficulty. Currently all of my texture initializations and texture operations are in the main file, but that file is getting huge. I want to make a new class for some of the items and functions that go together. That way I can put those functions in their own file.(What I’m working with is a GPGPU simulation using particles and a grid. All of the computation operations are done with textures and fragment programs. I’m trying to break up some of the operations, like “moveParticles” into another file.)
What I’m confused about is how to share my textures between my created class and the main file. Like if I have a call to draw a textured polygon in a “particles” class.
[ul][li]If I initialize a texture in my “particles” class, how can I reference and use that texture in my main file?On the same note, how can I use a texture created in the main file in my “particles” class? How would I “pass” it?Or should I only create/initialize textures in the main file?[/ul][/li]
I understand passing objects to classes, but I don’t know how to refer to a texture other than by it’s textureID.