Skip to content

Commit

Permalink
Refactor|GL|libgui: Use Qt 5.4 OpenGL APIs, renamed GLTarget/GLFrameb…
Browse files Browse the repository at this point in the history
…uffer

Qt 5 comes with new OpenGL classes (prefix "QOpenGL") and a portable
way to access OpenGL and extension functions. This commit takes these
into use and removes the old custom "glentrypoints".

The functionality of the GL code was not changed, and the OpenGL
version is kept at 2.1 (for now). Bumping to OpenGL 3/4 will require
larger revisions in the world renderer.

Multisampling is temporarily disabled pending a better implementation.

`GLTarget` was renamed to `GLFramebuffer` to more clearly indicate that
this is a wrapper around an FBO.

(The old) `GLFramebuffer` was renamed to `GLTextureFramebuffer` and is
now a subclass of (the new) `GLFramebuffer`, to indicate that this is
a specialized FBO that owns the buffer textures.
  • Loading branch information
skyjake committed Sep 4, 2016
1 parent a49da63 commit fbd925e
Show file tree
Hide file tree
Showing 31 changed files with 1,861 additions and 2,145 deletions.
3 changes: 2 additions & 1 deletion doomsday/sdk/libcore/include/de/libcore.h
Expand Up @@ -72,9 +72,10 @@

#if defined(__cplusplus) && !defined(DENG2_C_API_ONLY)
# define DENG2_USE_QT
# include <cstddef> // size_t
# include <cstring> // memset
# include <typeinfo>
# include <memory> // unique_ptr, shared_ptr
# include <cstring> // memset
#endif

#if defined(__x86_64__) || defined(__x86_64) || defined(_LP64) || defined(DENG_64BIT_HOST)
Expand Down
12 changes: 8 additions & 4 deletions doomsday/sdk/libgui/CMakeLists.txt
Expand Up @@ -51,6 +51,12 @@ set (CMAKE_C_FLAGS ${oldCFlags})
# Apply Doomsday's configuration.
include (../../cmake/Config.cmake)

# libgui uses Qt 5.4 OpenGL APIs.
qmake_query (QT_VERSION "QT_VERSION")
if (QT_VERSION VERSION_LESS 5.4)
message (FATAL_ERROR "libgui requires Qt 5.4 or newer! You can disable all GUI features with DENG_ENABLE_GUI=OFF.")
endif ()

if (APPLE)
# Don't change display modes on OS X. We'll instead resize the
# frame buffer and scale up.
Expand All @@ -65,8 +71,6 @@ option (DENG_ENABLE_DISPLAYMODE "Enable/disable changing the display mode"
# Dependencies.
find_package (DengCore)
find_package (Assimp REQUIRED)
include (OpenGL)

if (DENG_X11)
find_package (X11 REQUIRED)
endif ()
Expand Down Expand Up @@ -97,9 +101,9 @@ deng_add_library (libgui ${SOURCES} ${HEADERS})

target_link_libraries (libgui
PUBLIC Deng::libcore
PRIVATE opengl libassimp
PRIVATE libassimp
)
deng_target_link_qt (libgui PUBLIC Gui OpenGL)
deng_target_link_qt (libgui PUBLIC Gui OpenGLExtensions Widgets)

if (UNIX AND NOT APPLE)
# The assimp target may be linked to some system libraries that
Expand Down
1 change: 0 additions & 1 deletion doomsday/sdk/libgui/include/de/GLTarget

This file was deleted.

1 change: 1 addition & 0 deletions doomsday/sdk/libgui/include/de/GLTextureFramebuffer
@@ -0,0 +1 @@
#include "graphics/gltextureframebuffer.h"
4 changes: 2 additions & 2 deletions doomsday/sdk/libgui/include/de/graphics/drawable.h
Expand Up @@ -13,7 +13,7 @@
* of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser
* General Public License for more details. You should have received a copy of
* the GNU Lesser General Public License along with this program; if not, see:
* http://www.gnu.org/licenses</small>
* http://www.gnu.org/licenses</small>
*/

#ifndef LIBGUI_DRAWABLE_H
Expand All @@ -35,7 +35,7 @@ namespace de {
/**
* Drawable object with buffers, programs and states.
*
* This is the higher level, flexible, user-friendly combination of the lower
* This is the higher level, flexible and user-friendly combination of the lower
* level GL classes. It is not mandatory to use this class for drawing; one can
* always use the lower level classes directly.
*
Expand Down
167 changes: 0 additions & 167 deletions doomsday/sdk/libgui/include/de/graphics/glentrypoints.h

This file was deleted.

0 comments on commit fbd925e

Please sign in to comment.