Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. Game Development
  4. OpenGL shows black screen when using CMAKE system in QT5
Forum Updated to NodeBB v4.3 + New Features

OpenGL shows black screen when using CMAKE system in QT5

Scheduled Pinned Locked Moved Game Development
2 Posts 2 Posters 2.2k Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • R Offline
    R Offline
    renato.viana
    wrote on last edited by
    #1

    Hi,

    I got the texture exemple and port the build system to CMAKE. But when I run it shows a black screen. I'm using QT5.

    Does everyone know something about it??

    Here is my CMAKE file:

    PROJECT(QtTexture)

    Find includes in corresponding build directories

    SET(CMAKE_INCLUDE_CURRENT_DIR ON)

    Instruct CMake to run moc automatically when needed.

    SET(CMAKE_AUTOMOC ON)

    Setting application files

    SET(HEADER_FILES window.h glwidget.h)

    SET(SRC_FILES main.cpp window.cpp glwidget.cpp)

    SET(RESOURCE_FILES textures.qrc)

    Setting the correct group to the file

    SOURCE_GROUP(Header FILES ${HEADER_FILES})
    SOURCE_GROUP(Source FILES ${SRC_FILES})
    SOURCE_GROUP(Resources FILES ${RESOURCE_FILES})

    QT5_ADD_RESOURCES(RESOURCES_GENERATED_FILES ${RESOURCE_FILES})

    Tell CMake to create the helloworld executable

    ADD_EXECUTABLE(QtTexture ${SRC_FILES} ${HEADER_FILES} ${RESOURCES_GENERATED_FILES})

    Adding depencies

    #ADD_DEPENDENCIES( test_shader dv3d_core )

    Link to libraries

    TARGET_LINK_LIBRARIES(QtTexture OPENGL32 GLU32 GLEW32)

    Use the Widgets module from Qt 5.

    QT5_USE_MODULES(QtTexture Core Widgets OpenGL)

    Thanks,
    Renato

    1 Reply Last reply
    0
    • K Offline
      K Offline
      koahnig
      wrote on last edited by
      #2

      "same topic":http://qt-project.org/forums/viewthread/25569/
      Closing the double post.

      Vote the answer(s) that helped you to solve your issue(s)

      1 Reply Last reply
      0

      • Login

      • Login or register to search.
      • First post
        Last post
      0
      • Categories
      • Recent
      • Tags
      • Popular
      • Users
      • Groups
      • Search
      • Get Qt Extensions
      • Unsolved