Yeah, it failed, but I accomplished things I've never accomplished before. Things like textureswaps, moving bullets, gamestates etc. But therein lies the problem. I have never done such a thing before so I kinda suck at designing it(yes, I have started to write down my thoughts now). So I froze it the day before yesterday.
What now?
Well, since I managed to do textureswaps, gamestates and (partly) bullets, I thought I'd do it the proper way(Meaning acctualy deleting my allocated memory [grin]). So yesterday I started out with an ambitious idea to write my own allocation functions. It crashed... But today is a fresh day, and I would like some help on how to do things. So here's some questions:
How do you delete/store your resources?
Do you store them in one big std::vector or do you store them in separate ones?
Do you keep rendervectors?
I mean, f.ex in the menu state do you make a std::vector and in the gamestate do you make another one?
Do you even use std::vectors?
I read HopeDaggers journal and he said he used std::lists, I don't have any experience with std::lists.
Do you make a STATE class or do you just use a global string called gState?
How do you generate your textures(OpenGL)?
I managed to do this, but I'm not sure it's the best way. Right now when I create an object I push_back it to a static std::vector called Renderer::textures and store the position, then I call a method in Renderer which is called GenerateTextures which traverse through the Renderer::textures and calls glGenerateTextures(1, Renderer::textures). finnaly I retrieve my GLuint from the Renderer::textures list and load in images using SDL.
Thanks for any input!