From 5d46b773875ebfb67aef0e9eb0bca87b70cb75d5 Mon Sep 17 00:00:00 2001 From: Stefanos Kornilios Mitsis Poiitidis Date: Wed, 5 Aug 2015 21:11:00 +0200 Subject: [PATCH] OSX: How about initializing opengl before using it? --- shell/osx/emulator-osx/emulator-osx/EmuGLView.swift | 3 +++ .../emulator-osx/emulator-osx/emulator-osx-Bridging-Header.h | 1 + shell/osx/emulator-osx/emulator-osx/osx-main.cpp | 5 +++++ 3 files changed, 9 insertions(+) diff --git a/shell/osx/emulator-osx/emulator-osx/EmuGLView.swift b/shell/osx/emulator-osx/emulator-osx/EmuGLView.swift index a491fbc64..ff378ce46 100644 --- a/shell/osx/emulator-osx/emulator-osx/EmuGLView.swift +++ b/shell/osx/emulator-osx/emulator-osx/EmuGLView.swift @@ -49,6 +49,9 @@ class EmuGLView: NSOpenGLView { self.pixelFormat = pf; self.openGLContext = context; + + openGLContext.makeCurrentContext() + emu_gles_init(); } diff --git a/shell/osx/emulator-osx/emulator-osx/emulator-osx-Bridging-Header.h b/shell/osx/emulator-osx/emulator-osx/emulator-osx-Bridging-Header.h index 1c5059d2c..605584da1 100644 --- a/shell/osx/emulator-osx/emulator-osx/emulator-osx-Bridging-Header.h +++ b/shell/osx/emulator-osx/emulator-osx/emulator-osx-Bridging-Header.h @@ -11,4 +11,5 @@ void emu_main(); bool emu_single_frame(int w, int h); +void emu_gles_init(); #endif diff --git a/shell/osx/emulator-osx/emulator-osx/osx-main.cpp b/shell/osx/emulator-osx/emulator-osx/osx-main.cpp index 545d93315..f3b79dacb 100644 --- a/shell/osx/emulator-osx/emulator-osx/osx-main.cpp +++ b/shell/osx/emulator-osx/emulator-osx/osx-main.cpp @@ -104,6 +104,7 @@ extern "C" void emu_main() { extern int screen_width,screen_height; bool rend_single_frame(); +bool gles_init(); extern "C" bool emu_single_frame(int w, int h) { if (!has_init) @@ -111,4 +112,8 @@ extern "C" bool emu_single_frame(int w, int h) { screen_width = w; screen_height = h; return rend_single_frame(); +} + +extern "C" void emu_gles_init() { + gles_init(); } \ No newline at end of file