Skip to content
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

Open
wants to merge 16 commits into
base: master
Choose a base branch
from
Open

Add Scene Loader #16

wants to merge 16 commits into from

Conversation

Shervanator
Copy link
Owner

No description provided.

@Shervanator
Copy link
Owner Author

@chobomuffin lol what a scam you cant check in this:
11,683 assets/RotatingCircularLogoDark.dae

@Shervanator Shervanator force-pushed the neck_levl branch 3 times, most recently from ac2a68f to 4d49662 Compare February 18, 2016 06:04
@@ -31,8 +31,9 @@ class GLManager
GLManager(int width, int height);
~GLManager(void);

void renderScene(Entity *entity);
void renderScenes(std::vector<Entity*> entities);
Copy link

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);
Copy link

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;
Copy link

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;
Copy link

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;

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants