• Create Account

#ActualKrankles

Posted 10 February 2013 - 06:44 PM

Weird, the problem is that since I'm using cmake and make to build my project, it somehow causes my program to instantly close on Windows... So if I just do "g++ main.cpp -lglew32 -lglfw -lopengl32" the program runs just fine! This is my CMakeLists.txt

cmake_minimum_required(VERSION 2.8)
project(test)

set(CMAKE_CXX_FLAGS ${FLAGS}) find_package(OpenGL REQUIRED) set(CMAKE_MODULE_PATH cmake_scripts/) find_package(GLFW REQUIRED) include_directories(${GLFW_INCLUDE_DIR})

find_package(GLEW REQUIRED)
include_directories(${GLEW_INCLUDE_PATH}) add_executable(test main.cpp) target_link_libraries(test${GLEW_LIBRARY} ${GLFW_LIBRARY}${OPENGL_LIBRARY})


Now, I got my FindGLEW.cmake from here http://code.google.com/p/assembly3d/source/browse/tools/viewer/cmake_scripts/FindGLEW.cmake and my FindGLFW.cmake from here http://code.google.com/p/assembly3d/source/browse/tools/viewer/cmake_scripts/FindGLFW.cmake

I don't know if there's a faulty with them (since I'm new to using cmake) but now I know that using it somehow causes my program to close immediately (note that it doesn't crash, it just closes immediately.) The program draws the triangle and stuff fine. I'm using version 4.7.2 of MinGW. This is all on Windows 7, not Linux.

On Linux, the program runs fine, but still doesn't draw that triangle that I see when running on Windows. I don't understand, is it because of when getting the GL_VERSION, it reports back 2.1 Mesa 9.0.1? It doesn't say 4.2.0 like on windows (Probably because of using VirtualBox and not being able to install a real graphics driver). Even using the command "g++ main.cpp -lglfw -lGL -lGLEW" doesn't fix the problem of the triangle not drawing.

Basically now, my questions are:

1. How come when running cmake/make on windows causes my program to somehow instantly close? And how can I fix it? The workaround is to just use g++ manually, but I really want to use cmake/make.

2. Why doesn't the triangle draw on my virtualized linux OS but it does on my main OS, Windows 7? And how can I fix it?

EDIT: Just in case, on my linux OS, I'm using a tiling window manager, which is i3-wm. Which you can find right here http://i3wm.org/ Using this tiling window manager has caused me some problems when developing a game. When I used SFML 2.0, I would run my game created using SFML 2.0 from the terminal. I would then move it out into floating mode instead of tiled mode so that it would work as a normal window instead of being tiled together with other windows. This would cause my SFML game to rescale the images and somehow make the game use unused space. You can see image here:

and this is what happens when I move the terminal around on the pong game.

Now this is just an idea, I don't know if this is actually the problem with the triangle not rendering on my linux machine, but I'm just throwing it out there. (The art is from Game From Scratch by Serapth (i think), was too lazy to make my own art )

#2Krankles

Posted 10 February 2013 - 04:41 PM

Weird, the problem is that since I'm using cmake and make to build my project, it somehow causes my program to instantly close on Windows... So if I just do "g++ main.cpp -lglew32 -lglfw -lopengl32" the program runs just fine! This is my CMakeLists.txt

cmake_minimum_required(VERSION 2.8)
project(test)

set(CMAKE_CXX_FLAGS ${FLAGS}) find_package(OpenGL REQUIRED) set(CMAKE_MODULE_PATH cmake_scripts/) find_package(GLFW REQUIRED) include_directories(${GLFW_INCLUDE_DIR})

find_package(GLEW REQUIRED)
include_directories(${GLEW_INCLUDE_PATH}) add_executable(test main.cpp) target_link_libraries(test${GLEW_LIBRARY} ${GLFW_LIBRARY}${OPENGL_LIBRARY})


Now, I got my FindGLEW.cmake from here http://code.google.com/p/assembly3d/source/browse/tools/viewer/cmake_scripts/FindGLEW.cmake and my FindGLFW.cmake from here http://code.google.com/p/assembly3d/source/browse/tools/viewer/cmake_scripts/FindGLFW.cmake

I don't know if there's a faulty with them (since I'm new to using cmake) but now I know that using it somehow causes my program to close immediately (note that it doesn't crash, it just closes immediately.) The program draws the triangle and stuff fine. I'm using version 4.7.2 of MinGW. This is all on Windows 7, not Linux.

On Linux, the program runs fine, but still doesn't draw that triangle that I see when running on Windows. I don't understand, is it because of when getting the GL_VERSION, it reports back 2.1 Mesa 9.0.1? It doesn't say 4.2.0 like on windows (Probably because of using VirtualBox and not being able to install a real graphics driver). Even using the command "g++ main.cpp -lglfw -lGL -lGLEW" doesn't fix the problem of the triangle not drawing.

Basically now, my questions are:

1. How come when running cmake/make on windows causes my program to somehow instantly close? And how can I fix it? The workaround is to just use g++ manually, but I really want to use cmake/make.

2. Why doesn't the triangle draw on my virtualized linux OS but it does on my main OS, Windows 7? And how can I fix it?

EDIT: Just in case, on my linux OS, I'm using a tiling window manager, which is i3-wm. Which you can find right here http://i3wm.org/ Using this tiling window manager has caused me some problems when developing a game. When I used SFML 2.0, I would run my game created using SFML 2.0 from the terminal. I would then move it out into floating mode instead of tiled mode so that it would work as a normal window instead of being tiled together with other windows. This would cause my SFML game to rescale the images and somehow make the game use unused space. You can see image here:

and this is what happens when I move the terminal around on the pong game.

Now this is just an idea, I don't know if this is actually the problem with the triangle not rendering on my linux machine, but I'm just throwing it out there.

#1Krankles

Posted 10 February 2013 - 04:03 PM

Weird, the problem is that since I'm using cmake and make to build my project, it somehow causes my program to instantly close on Windows... So if I just do "g++ main.cpp -lglew32 -lglfw -lopengl32" the program runs just fine! This is my CMakeLists.txt

cmake_minimum_required(VERSION 2.8)
project(test)

set(CMAKE_CXX_FLAGS ${FLAGS}) find_package(OpenGL REQUIRED) set(CMAKE_MODULE_PATH cmake_scripts/) find_package(GLFW REQUIRED) include_directories(${GLFW_INCLUDE_DIR})

find_package(GLEW REQUIRED)
include_directories(${GLEW_INCLUDE_PATH}) add_executable(test main.cpp) target_link_libraries(test${GLEW_LIBRARY} ${GLFW_LIBRARY}${OPENGL_LIBRARY})


Now, I got my FindGLEW.cmake from here http://code.google.com/p/assembly3d/source/browse/tools/viewer/cmake_scripts/FindGLEW.cmake and my FindGLFW.cmake from here http://code.google.com/p/assembly3d/source/browse/tools/viewer/cmake_scripts/FindGLFW.cmake

I don't know if there's a faulty with them (since I'm new to using cmake) but now I know that using it somehow causes my program to close immediately (note that it doesn't crash, it just closes immediately.) The program draws the triangle and stuff fine. I'm using version 4.7.2 of MinGW. This is all on Windows 7, not Linux.

On Linux, the program runs fine, but still doesn't draw that triangle that I see when running on Windows. I don't understand, is it because of when getting the GL_VERSION, it reports back 2.1 Mesa 9.0.1? It doesn't say 4.2.0 like on windows (Probably because of using VirtualBox and not being able to install a real graphics driver). Even using the command "g++ main.cpp -lglfw -lGL -lGLEW" doesn't fix the problem of the triangle not drawing.

Basically now, my questions are:

1. How come when running cmake/make on windows causes my program to somehow instantly close? And how can I fix it? The workaround is to just use g++ manually, but I really want to use cmake/make.

2. Why doesn't the triangle draw on my virtualized linux OS but it does on my main OS, Windows 7? And how can I fix it?

PARTNERS