This forum has been archived. All content is frozen. Please use KDE Discuss instead.

GLFW+GLEW not drawing...

Tags: None
(comma "," separated)
kapichu
Registered Member
Posts
2
Karma
0

GLFW+GLEW not drawing...

Mon Jun 23, 2014 1:45 pm
Hi!
I've made a little program with GLFW and GLEW in Code::Blocks, running perfectly. But if I compile it with cmake (without any errors or warnings), the window does show up but not display anything but the glClear() call (Changing the color with glClearColor() affects the window), but not my glDrawArrays, altough compiled under Code::Blocks it works...
I think it is cmake-related, because I have never used it, so here is my CMakeLists.txt:

Code: Select all
project(cells)

add_executable(cells cells_render.c cells.c main.c)

find_package(PkgConfig REQUIRED)
pkg_search_module(GLFW REQUIRED glfw3)
include_directories(${GLFW_INCLUDE_DIRS})
target_link_libraries(cells ${GLFW_STATIC_LIBRARIES})

find_package(GLEW REQUIRED)
target_link_libraries(cells ${GLEW_LIBRARIES})


install(TARGETS cells RUNTIME DESTINATION bin)


and I am using FindGLEW.cmake to find GLEW:

Code: Select all
#
# Try to find GLEW library and include path.
# Once done this will define
#
# GLEW_FOUND
# GLEW_INCLUDE_PATH
# GLEW_LIBRARY
#

IF (WIN32)
FIND_PATH( GLEW_INCLUDE_PATH GL/glew.h
$ENV{PROGRAMFILES}/GLEW/include
${GLEW_ROOT_DIR}/include
DOC "The directory where GL/glew.h resides")

FIND_LIBRARY( GLEW_LIBRARY
NAMES glew GLEW glew32 glew32s
PATHS
$ENV{PROGRAMFILES}/GLEW/lib
${PROJECT_SOURCE_DIR}/src/nvgl/glew/bin
${PROJECT_SOURCE_DIR}/src/nvgl/glew/lib
DOC "The GLEW library")
ELSE (WIN32)
FIND_PATH( GLEW_INCLUDE_PATH GL/glew.h
/usr/include
/usr/local/include
/sw/include
/opt/local/include
${GLEW_ROOT_DIR}/include
DOC "The directory where GL/glew.h resides")

# Prefer the static library.
FIND_LIBRARY( GLEW_LIBRARY
NAMES libGLEW.a GLEW
PATHS
/usr/lib64
/usr/lib
/usr/local/lib64
/usr/local/lib
/sw/lib
/opt/local/lib
${GLEW_ROOT_DIR}/lib
DOC "The GLEW library")
ENDIF (WIN32)

SET(GLEW_FOUND "NO")
IF (GLEW_INCLUDE_PATH AND GLEW_LIBRARY)
SET(GLEW_LIBRARIES ${GLEW_LIBRARY})
SET(GLEW_FOUND "YES")
ENDIF (GLEW_INCLUDE_PATH AND GLEW_LIBRARY)


GLFW is compiled and installed from source, GLEW via apt-get.
I am using Linux Mint 17 KDE.
I hope I provided enough information and that you can help me...
kapichu
Registered Member
Posts
2
Karma
0

Re: GLFW+GLEW not drawing...  Topic is solved

Tue Jun 24, 2014 12:35 pm
Okay I figured it out, I think it was KDE-related:
In my vertex shader, I wrote:

...
gl_Position.xy = vertPos_in;
...

, ignoring the z and w values of gl_Position. On Linux Mint 16 Cinnamon with CodeBlocks it worked, but not anymore in Linux Mint 17 KDE with KDevelop. Sorry for my stupidness... :<
User avatar
scummos
Global Moderator
Posts
1175
Karma
7
OS

Re: GLFW+GLEW not drawing...

Tue Jun 24, 2014 12:47 pm
Probably more related to an updated graphics driver then, I'd guess ;)


I'm working on the KDevelop IDE.


Bookmarks



Who is online

Registered users: Bing [Bot], daret, Google [Bot], Sogou [Bot]