-
Notifications
You must be signed in to change notification settings - Fork 63
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add Scene Loader #16
base: master
Are you sure you want to change the base?
Add Scene Loader #16
Conversation
@chobomuffin lol what a scam you cant check in this: |
ac2a68f
to
4d49662
Compare
@@ -31,8 +31,9 @@ class GLManager | |||
GLManager(int width, int height); | |||
~GLManager(void); | |||
|
|||
void renderScene(Entity *entity); | |||
void renderScenes(std::vector<Entity*> entities); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Even though it is not completely necessary you should think about passing std::vectors by reference to prevent copying. You should also think about decoupling your entity representation from the renderer and feed your renderer with the necessary structures for rendering from the outside instead of passing your entities.
|
||
void TextureData::updateTexture(unsigned char* data) | ||
{ | ||
glBindTexture(m_textureTarget, m_textureId); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If you have a GLManager, then try to move the GL-specific code to the GLManager (e. g. try passing a *TextureData
to a GLManager->initTexture method and then initialize it there).
} | ||
|
||
int TextureData::getHeight(void) { | ||
return m_height; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You could also think about implementing an isAlpha
method returning if the texture is an RGBA texture which allows for transparency sorting later.
} | ||
|
||
void Animation::updateFrameNumber(int frameNumber) { | ||
previousFrame = currentFrame; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You can reset your animation by using currentFrame = frameNumber % MAX_FRAMES;
No description provided.