Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Create our OGL context on the same thread in the OpenGL backend. Same…
… issue with Qualcomm not working with threading correctly.
  • Loading branch information
Sonicadvance1 committed May 27, 2013
1 parent f06fc78 commit 2697b8c
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 13 deletions.
5 changes: 4 additions & 1 deletion Source/Plugins/Plugin_VideoOGL/Src/GLUtil.cpp
Expand Up @@ -24,7 +24,10 @@ namespace OGL
// Draw messages on top of the screen
unsigned int VideoBackend::PeekMessages()
{
return GLInterface->PeekMessages();
if (GLInterface)
return GLInterface->PeekMessages();
else
return 0;
}

// Show the current FPS
Expand Down
26 changes: 14 additions & 12 deletions Source/Plugins/Plugin_VideoOGL/Src/main.cpp
Expand Up @@ -89,6 +89,7 @@ Make AA apply instantly during gameplay if possible

namespace OGL
{
static void* m_windowhandle;

std::string VideoBackend::GetName()
{
Expand Down Expand Up @@ -149,15 +150,12 @@ void VideoBackend::ShowConfig(void *_hParent)
diag.ShowModal();
#endif
}
void Test(u32 Data)
{
printf("Data: %d\n", Data);
}
bool VideoBackend::Initialize(void *&window_handle)
{
InitializeShared();
InitBackendInfo();


m_windowhandle = window_handle;
frameCount = 0;

g_Config.Load((File::GetUserPath(D_CONFIG_IDX) + "gfx_opengl.ini").c_str());
Expand All @@ -166,13 +164,7 @@ bool VideoBackend::Initialize(void *&window_handle)
g_Config.VerifyValidity();
UpdateActiveConfig();

InitInterface();
if (!GLInterface->Create(window_handle))
return false;

// Do our OSD callbacks
OSD::DoCallbacks(OSD::OSD_INIT);


s_BackendInitialized = true;

return true;
Expand All @@ -182,6 +174,16 @@ bool VideoBackend::Initialize(void *&window_handle)
// Run from the graphics thread
void VideoBackend::Video_Prepare()
{
InitInterface();
if (!GLInterface->Create(m_windowhandle))
{
INFO_LOG(VIDEO, "%s", "GLInterface::Create failed\n");
return;
}

// Do our OSD callbacks
OSD::DoCallbacks(OSD::OSD_INIT);

GLInterface->MakeCurrent();

g_renderer = new Renderer;
Expand Down

0 comments on commit 2697b8c

Please sign in to comment.