Fixed some camera bugs.
This commit is contained in:
@@ -7,8 +7,9 @@
|
||||
|
||||
#include "display/display.h"
|
||||
#include "console/console.h"
|
||||
#include "display/renderer.h"
|
||||
#include "display/framebuffer/framebuffer.h"
|
||||
#include "display/scene/scenemanager.h"
|
||||
#include "display/spritebatch/spritebatch.h"
|
||||
|
||||
#include "display/mesh/quad.h"
|
||||
|
||||
@@ -59,6 +60,8 @@ errorret_t displayInit(void) {
|
||||
|
||||
quadInit();
|
||||
frameBufferInitBackbuffer();
|
||||
spriteBatchInit();
|
||||
sceneManagerInit();
|
||||
|
||||
errorOk();
|
||||
}
|
||||
@@ -82,18 +85,30 @@ errorret_t displayUpdate(void) {
|
||||
SDL_GetWindowSize(DISPLAY.window, &windowWidth, &windowHeight);
|
||||
glViewport(0, 0, windowWidth, windowHeight);
|
||||
#endif
|
||||
|
||||
// rendererRender(CAMERA_MAIN);
|
||||
|
||||
frameBufferBind(&FRAMEBUFFER_BACKBUFFER);
|
||||
spriteBatchClear();
|
||||
|
||||
sceneManagerUpdate();
|
||||
sceneManagerRender();
|
||||
|
||||
#if DISPLAY_SDL2
|
||||
SDL_GL_SwapWindow(DISPLAY.window);
|
||||
#endif
|
||||
|
||||
GLenum err = glGetError();
|
||||
if (err != GL_NO_ERROR) {
|
||||
printf("GL Error: %d\n", err);
|
||||
}
|
||||
|
||||
// For now, we just return an OK error.
|
||||
errorOk();
|
||||
}
|
||||
|
||||
errorret_t displayDispose(void) {
|
||||
sceneManagerDispose();
|
||||
spriteBatchDispose();
|
||||
|
||||
#if DISPLAY_SDL2
|
||||
if(DISPLAY.glContext) {
|
||||
SDL_GL_DeleteContext(DISPLAY.glContext);
|
||||
|
Reference in New Issue
Block a user