Skip to content

Commit

Permalink
Turned the Gl class into a namespace; fixes to the OpenGL renderer
Browse files Browse the repository at this point in the history
  • Loading branch information
leiradel committed Mar 31, 2018
1 parent 1193d49 commit 5d0f6c4
Show file tree
Hide file tree
Showing 6 changed files with 378 additions and 355 deletions.
15 changes: 14 additions & 1 deletion src/Application.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -78,6 +78,7 @@ bool Application::init(const char* title, int width, int height)
kAllocatorInited,
kSdlInited,
kWindowInited,
kGlInited,
kAudioDeviceInited,
kFifoInited,
kAudioInited,
Expand Down Expand Up @@ -154,6 +155,15 @@ bool Application::init(const char* title, int width, int height)

inited = kWindowInited;

Gl::init(&_logger);

if (!Gl::ok())
{
goto error;
}

inited = kGlInited;

// Init audio
SDL_AudioSpec want;
memset(&want, 0, sizeof(want));
Expand Down Expand Up @@ -261,6 +271,7 @@ bool Application::init(const char* title, int width, int height)
case kAudioInited: _audio.destroy();
case kFifoInited: _fifo.destroy();
case kAudioDeviceInited: SDL_CloseAudioDevice(_audioDev);
case kGlInited: // nothing to undo
case kWindowInited: SDL_DestroyWindow(_window);
case kSdlInited: SDL_Quit();
case kAllocatorInited: _allocator.destroy();
Expand Down Expand Up @@ -349,7 +360,9 @@ void Application::run()
RA_DoAchievementsFrame();
}

_video.draw();
Gl::clear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT);
_video.draw();
SDL_GL_SwapWindow(_window);

RA_HandleHTTPResults();

Expand Down
1 change: 1 addition & 0 deletions src/Application.h
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@ along with Foobar. If not, see <http://www.gnu.org/licenses/>.

#include "Emulator.h"
#include "KeyBinds.h"
#include "Gl.h"

class Application
{
Expand Down
Loading

0 comments on commit 5d0f6c4

Please sign in to comment.