Skip to content

Commit 368b16a

Browse files
authored
Update ofAppGLFWWindow.cpp
1 parent aaf8228 commit 368b16a

File tree

1 file changed

+12
-4
lines changed

1 file changed

+12
-4
lines changed

libs/openFrameworks/app/ofAppGLFWWindow.cpp

Lines changed: 12 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,14 @@ using std::numeric_limits;
3737
using std::shared_ptr;
3838
using std::vector;
3939

40+
namespace of{
41+
namespace priv{
42+
bool InitGLFW(){
43+
return glfwInit();
44+
}
45+
}
46+
}
47+
4048
//-------------------------------------------------------
4149
ofAppGLFWWindow::ofAppGLFWWindow()
4250
: coreEvents(new ofCoreEvents) {
@@ -155,8 +163,8 @@ void ofAppGLFWWindow::setup(const ofGLESWindowSettings & settings) {
155163
return;
156164
}
157165
settings = _settings;
158-
159-
if (!glfwInit()) {
166+
167+
if (!of::priv::InitGLFW()) {
160168
ofLogError("ofAppGLFWWindow") << "couldn't init GLFW";
161169
return;
162170
}
@@ -1685,7 +1693,7 @@ void ofAppGLFWWindow::setup(const ofGLESWindowSettings & settings) {
16851693

16861694
//------------------------------------------------------------
16871695
void ofAppGLFWWindow::listVideoModes() {
1688-
glfwInit();
1696+
of::priv::InitGLFW();
16891697
int numModes;
16901698
const GLFWvidmode * vidModes = glfwGetVideoModes(nullptr, &numModes);
16911699
for (int i = 0; i < numModes; i++) {
@@ -1696,7 +1704,7 @@ void ofAppGLFWWindow::setup(const ofGLESWindowSettings & settings) {
16961704

16971705
//------------------------------------------------------------
16981706
void ofAppGLFWWindow::listMonitors() {
1699-
glfwInit();
1707+
of::priv::InitGLFW();
17001708
int count;
17011709
const auto monitors = glfwGetMonitors(&count);
17021710
for (int i = 0; i < count; i++) {

0 commit comments

Comments
 (0)