Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 12 additions & 4 deletions libs/openFrameworks/app/ofAppGLFWWindow.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,14 @@ using std::numeric_limits;
using std::shared_ptr;
using std::vector;

namespace of{
namespace priv{
bool InitGLFW(){
return glfwInit();
}
}
}

//-------------------------------------------------------
ofAppGLFWWindow::ofAppGLFWWindow()
: coreEvents(new ofCoreEvents) {
Expand Down Expand Up @@ -155,8 +163,8 @@ void ofAppGLFWWindow::setup(const ofGLESWindowSettings & settings) {
return;
}
settings = _settings;
if (!glfwInit()) {
if (!of::priv::InitGLFW()) {
ofLogError("ofAppGLFWWindow") << "couldn't init GLFW";
return;
}
Expand Down Expand Up @@ -1685,7 +1693,7 @@ void ofAppGLFWWindow::setup(const ofGLESWindowSettings & settings) {

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

//------------------------------------------------------------
void ofAppGLFWWindow::listMonitors() {
glfwInit();
of::priv::InitGLFW();
int count;
const auto monitors = glfwGetMonitors(&count);
for (int i = 0; i < count; i++) {
Expand Down
Loading