mirror of https://github.com/mosra/magnum.git
Browse Source
Minimal updates (just the include guards) so Git is hopefully able to detect the rename and track the history properly. Everything except Magnum::GL doesn't compile now.pull/233/head
183 changed files with 1933 additions and 1687 deletions
@ -0,0 +1,257 @@
|
||||
# |
||||
# This file is part of Magnum. |
||||
# |
||||
# Copyright © 2010, 2011, 2012, 2013, 2014, 2015, 2016, 2017, 2018 |
||||
# Vladimír Vondruš <mosra@centrum.cz> |
||||
# |
||||
# Permission is hereby granted, free of charge, to any person obtaining a |
||||
# copy of this software and associated documentation files (the "Software"), |
||||
# to deal in the Software without restriction, including without limitation |
||||
# the rights to use, copy, modify, merge, publish, distribute, sublicense, |
||||
# and/or sell copies of the Software, and to permit persons to whom the |
||||
# Software is furnished to do so, subject to the following conditions: |
||||
# |
||||
# The above copyright notice and this permission notice shall be included |
||||
# in all copies or substantial portions of the Software. |
||||
# |
||||
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR |
||||
# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, |
||||
# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL |
||||
# THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER |
||||
# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING |
||||
# FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER |
||||
# DEALINGS IN THE SOFTWARE. |
||||
# |
||||
|
||||
set(MagnumGL_SRCS |
||||
AbstractFramebuffer.cpp |
||||
AbstractObject.cpp |
||||
AbstractTexture.cpp |
||||
AbstractShaderProgram.cpp |
||||
Attribute.cpp |
||||
Buffer.cpp |
||||
CubeMapTexture.cpp |
||||
Context.cpp |
||||
DefaultFramebuffer.cpp |
||||
Framebuffer.cpp |
||||
../Image.cpp # temporary |
||||
../ImageView.cpp # temporary |
||||
Mesh.cpp |
||||
MeshView.cpp |
||||
OpenGL.cpp |
||||
PixelFormat.cpp |
||||
../PixelStorage.cpp # temporary |
||||
Renderbuffer.cpp |
||||
Renderer.cpp |
||||
Sampler.cpp |
||||
Shader.cpp |
||||
Texture.cpp |
||||
Version.cpp |
||||
|
||||
Implementation/BufferState.cpp |
||||
Implementation/ContextState.cpp |
||||
Implementation/FramebufferState.cpp |
||||
Implementation/MeshState.cpp |
||||
Implementation/RendererState.cpp |
||||
Implementation/ShaderProgramState.cpp |
||||
Implementation/ShaderState.cpp |
||||
Implementation/State.cpp |
||||
Implementation/TextureState.cpp |
||||
Implementation/driverSpecific.cpp |
||||
Implementation/maxTextureSize.cpp) |
||||
|
||||
set(MagnumGL_HEADERS |
||||
AbstractFramebuffer.h |
||||
AbstractObject.h |
||||
AbstractShaderProgram.h |
||||
AbstractTexture.h |
||||
Attribute.h |
||||
Buffer.h |
||||
Context.h |
||||
CubeMapTexture.h |
||||
DefaultFramebuffer.h |
||||
Extensions.h |
||||
Framebuffer.h |
||||
GL.h |
||||
Mesh.h |
||||
MeshView.h |
||||
OpenGL.h |
||||
PixelFormat.h |
||||
Renderbuffer.h |
||||
RenderbufferFormat.h |
||||
Renderer.h |
||||
Sampler.h |
||||
Shader.h |
||||
Texture.h |
||||
TextureFormat.h |
||||
Version.h |
||||
|
||||
visibility.h) |
||||
|
||||
# Header files to display in project view of IDEs only |
||||
set(MagnumGL_PRIVATE_HEADERS |
||||
Implementation/BufferState.h |
||||
Implementation/ContextState.h |
||||
Implementation/FramebufferState.h |
||||
Implementation/maxTextureSize.h |
||||
Implementation/MeshState.h |
||||
Implementation/RendererState.h |
||||
Implementation/ShaderProgramState.h |
||||
Implementation/ShaderState.h |
||||
Implementation/State.h |
||||
Implementation/TextureState.h) |
||||
|
||||
# Desktop-only stuff |
||||
if(NOT TARGET_GLES) |
||||
list(APPEND MagnumGL_SRCS RectangleTexture.cpp) |
||||
list(APPEND MagnumGL_HEADERS RectangleTexture.h) |
||||
endif() |
||||
|
||||
# OpenGL ES 3.0 and WebGL 2.0 stuff |
||||
if(NOT TARGET_GLES2) |
||||
list(APPEND MagnumGL_SRCS |
||||
BufferImage.cpp |
||||
PrimitiveQuery.cpp |
||||
TextureArray.cpp |
||||
TransformFeedback.cpp |
||||
|
||||
Implementation/TransformFeedbackState.cpp) |
||||
|
||||
list(APPEND MagnumGL_HEADERS |
||||
BufferImage.h |
||||
PrimitiveQuery.h |
||||
TextureArray.h |
||||
TransformFeedback.h) |
||||
|
||||
list(APPEND MagnumGL_PRIVATE_HEADES |
||||
Implementation/TransformFeedbackState.h) |
||||
endif() |
||||
|
||||
# Desktop and OpenGL ES stuff that is not available in WebGL |
||||
if(NOT TARGET_WEBGL) |
||||
list(APPEND MagnumGL_SRCS |
||||
DebugOutput.cpp |
||||
|
||||
Implementation/DebugState.cpp) |
||||
|
||||
list(APPEND MagnumGL_HEADERS |
||||
DebugOutput.h |
||||
TimeQuery.h) |
||||
|
||||
list(APPEND MagnumGL_PRIVATE_HEADERS |
||||
Implementation/DebugState.h) |
||||
|
||||
# Desktop and OpenGL ES 3.0 stuff that is not available in ES2 and WebGL |
||||
if(NOT TARGET_GLES2) |
||||
list(APPEND MagnumGL_SRCS |
||||
BufferTexture.cpp |
||||
CubeMapTextureArray.cpp |
||||
MultisampleTexture.cpp) |
||||
list(APPEND MagnumGL_HEADERS |
||||
BufferTexture.h |
||||
BufferTextureFormat.h |
||||
CubeMapTextureArray.h |
||||
ImageFormat.h |
||||
MultisampleTexture.h) |
||||
endif() |
||||
endif() |
||||
|
||||
# Desktop, OpenGL ES and WebGL 2.0 stuff that is not available in WebGL 1.0 |
||||
if(NOT (TARGET_WEBGL AND TARGET_GLES2)) |
||||
list(APPEND MagnumGL_SRCS |
||||
AbstractQuery.cpp |
||||
|
||||
Implementation/QueryState.cpp) |
||||
|
||||
list(APPEND MagnumGL_HEADERS |
||||
AbstractQuery.h |
||||
SampleQuery.h) |
||||
|
||||
list(APPEND MagnumGL_PRIVATE_HEADERS |
||||
Implementation/QueryState.h) |
||||
endif() |
||||
|
||||
# Link in GL function pointer variables on platforms that support it |
||||
if(NOT CORRADE_TARGET_EMSCRIPTEN) |
||||
list(APPEND MagnumGL_SRCS $<TARGET_OBJECTS:MagnumFlextGLObjects>) |
||||
endif() |
||||
|
||||
# GL library |
||||
add_library(MagnumGL ${SHARED_OR_STATIC} |
||||
${MagnumGL_SRCS} |
||||
${MagnumGL_HEADERS} |
||||
${MagnumGL_PRIVATE_HEADERS}) |
||||
set_target_properties(MagnumGL PROPERTIES |
||||
DEBUG_POSTFIX "-d" |
||||
FOLDER "Magnum/GL") |
||||
if(NOT BUILD_STATIC) |
||||
target_compile_definitions(MagnumGL PRIVATE "FlextGL_EXPORTS") |
||||
set_target_properties(MagnumGL PROPERTIES VERSION ${MAGNUM_LIBRARY_VERSION} SOVERSION ${MAGNUM_LIBRARY_SOVERSION}) |
||||
elseif(BUILD_STATIC_PIC) |
||||
set_target_properties(MagnumGL PROPERTIES POSITION_INDEPENDENT_CODE ON) |
||||
endif() |
||||
# We can use both implicit include path (GLES2/gl2.h) where our headers can |
||||
# be overriden with system ones or explicit (MagnumExternal/OpenGL/GLES2/gl2ext.h) |
||||
# where only our headers will be used |
||||
target_include_directories(MagnumGL PUBLIC |
||||
${PROJECT_SOURCE_DIR}/src |
||||
${PROJECT_BINARY_DIR}/src |
||||
${PROJECT_SOURCE_DIR}/src/MagnumExternal/OpenGL) |
||||
target_link_libraries(MagnumGL PUBLIC Magnum) |
||||
if(NOT TARGET_GLES OR TARGET_DESKTOP_GLES) |
||||
target_link_libraries(MagnumGL PUBLIC ${OPENGL_gl_LIBRARY}) |
||||
elseif(TARGET_GLES2) |
||||
target_link_libraries(MagnumGL PUBLIC OpenGLES2::OpenGLES2) |
||||
else() |
||||
target_link_libraries(MagnumGL PUBLIC OpenGLES3::OpenGLES3) |
||||
endif() |
||||
|
||||
install(TARGETS MagnumGL |
||||
RUNTIME DESTINATION ${MAGNUM_BINARY_INSTALL_DIR} |
||||
LIBRARY DESTINATION ${MAGNUM_LIBRARY_INSTALL_DIR} |
||||
ARCHIVE DESTINATION ${MAGNUM_LIBRARY_INSTALL_DIR}) |
||||
install(FILES ${MagnumGL_HEADERS} DESTINATION ${MAGNUM_INCLUDE_INSTALL_DIR}/GL) |
||||
|
||||
# OpenGLTester class |
||||
if(WITH_OPENGLTESTER) |
||||
find_package(Corrade REQUIRED TestSuite) |
||||
|
||||
set(MagnumOpenGLTester_SRCS OpenGLTester.cpp) |
||||
set(MagnumOpenGLTester_HEADERS OpenGLTester.h) |
||||
if(BUILD_DEPRECATED) |
||||
set(MagnumOpenGLTester_DEPRECATED_HEADERS ../Test/AbstractOpenGLTester.h) |
||||
endif() |
||||
|
||||
add_library(MagnumOpenGLTester STATIC |
||||
${MagnumOpenGLTester_SRCS} |
||||
${MagnumOpenGLTester_HEADERS} |
||||
${MagnumOpenGLTester_DEPRECATED_HEADERS}) # TODO: remove when the header is removed |
||||
set_target_properties(MagnumOpenGLTester PROPERTIES |
||||
DEBUG_POSTFIX "-d" |
||||
FOLDER "Magnum/GL") |
||||
# Assuming that PIC is not needed because the Tester lib is always linked |
||||
# to the executable and not to any intermediate shared lib |
||||
|
||||
# OPENGLTESTER_APPLICATION defined in the root CMakeLists, because it also |
||||
# enables the application library dependencies |
||||
target_link_libraries(MagnumOpenGLTester Magnum Corrade::TestSuite ${OPENGLTESTER_APPLICATION}) |
||||
|
||||
install(FILES ${MagnumOpenGLTester_HEADERS} DESTINATION ${MAGNUM_INCLUDE_INSTALL_DIR}/GL) |
||||
if(BUILD_DEPRECATED) |
||||
install(FILES ${MagnumOpenGLTester_DEPRECATED_HEADERS} DESTINATION ${MAGNUM_INCLUDE_INSTALL_DIR}/Test) |
||||
endif() |
||||
install(TARGETS MagnumOpenGLTester |
||||
RUNTIME DESTINATION ${MAGNUM_BINARY_INSTALL_DIR} |
||||
LIBRARY DESTINATION ${MAGNUM_LIBRARY_INSTALL_DIR} |
||||
ARCHIVE DESTINATION ${MAGNUM_LIBRARY_INSTALL_DIR}) |
||||
|
||||
# Magnum OpenGLTester target alias for superprojects |
||||
add_library(Magnum::OpenGLTester ALIAS MagnumOpenGLTester) |
||||
endif() |
||||
|
||||
if(BUILD_TESTS) |
||||
add_subdirectory(Test) |
||||
endif() |
||||
|
||||
# Magnum GL library target alias for superprojects |
||||
add_library(Magnum::GL ALIAS MagnumGL) |
||||
@ -0,0 +1,179 @@
|
||||
#ifndef Magnum_GL_h |
||||
#define Magnum_GL_h |
||||
/*
|
||||
This file is part of Magnum. |
||||
|
||||
Copyright © 2010, 2011, 2012, 2013, 2014, 2015, 2016, 2017, 2018 |
||||
Vladimír Vondruš <mosra@centrum.cz> |
||||
|
||||
Permission is hereby granted, free of charge, to any person obtaining a |
||||
copy of this software and associated documentation files (the "Software"), |
||||
to deal in the Software without restriction, including without limitation |
||||
the rights to use, copy, modify, merge, publish, distribute, sublicense, |
||||
and/or sell copies of the Software, and to permit persons to whom the |
||||
Software is furnished to do so, subject to the following conditions: |
||||
|
||||
The above copyright notice and this permission notice shall be included |
||||
in all copies or substantial portions of the Software. |
||||
|
||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR |
||||
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, |
||||
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL |
||||
THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER |
||||
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING |
||||
FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER |
||||
DEALINGS IN THE SOFTWARE. |
||||
*/ |
||||
|
||||
/** @file
|
||||
* @brief Forward declarations for the @ref Magnum::GL namespace |
||||
*/ |
||||
|
||||
#include "Magnum/Types.h" |
||||
|
||||
#ifndef DOXYGEN_GENERATING_OUTPUT |
||||
typedef unsigned int GLenum; /* Needed for *Format and *Type enums */ |
||||
#endif |
||||
|
||||
namespace Magnum { |
||||
|
||||
#ifndef DOXYGEN_GENERATING_OUTPUT |
||||
/* FramebufferClear[Mask], FramebufferBlit[Mask], FramebufferBlitFilter,
|
||||
FramebufferTarget enums used only directly with framebuffer instance */ |
||||
class AbstractFramebuffer; |
||||
|
||||
#if !(defined(MAGNUM_TARGET_WEBGL) && defined(MAGNUM_TARGET_GLES2)) |
||||
class AbstractQuery; |
||||
#endif |
||||
class AbstractShaderProgram; |
||||
class AbstractTexture; |
||||
|
||||
template<UnsignedInt, class> class Attribute; |
||||
|
||||
enum class BufferUsage: GLenum; |
||||
class Buffer; |
||||
|
||||
#ifndef MAGNUM_TARGET_GLES2 |
||||
template<UnsignedInt> class BufferImage; |
||||
typedef BufferImage<1> BufferImage1D; |
||||
typedef BufferImage<2> BufferImage2D; |
||||
typedef BufferImage<3> BufferImage3D; |
||||
|
||||
template<UnsignedInt> class CompressedBufferImage; |
||||
typedef CompressedBufferImage<1> CompressedBufferImage1D; |
||||
typedef CompressedBufferImage<2> CompressedBufferImage2D; |
||||
typedef CompressedBufferImage<3> CompressedBufferImage3D; |
||||
#endif |
||||
|
||||
#if !defined(MAGNUM_TARGET_GLES2) && !defined(MAGNUM_TARGET_WEBGL) |
||||
class BufferTexture; |
||||
enum class BufferTextureFormat: GLenum; |
||||
#endif |
||||
|
||||
class Context; |
||||
|
||||
class CubeMapTexture; |
||||
enum class CubeMapCoordinate: GLenum; |
||||
#if !defined(MAGNUM_TARGET_GLES2) && !defined(MAGNUM_TARGET_WEBGL) |
||||
class CubeMapTextureArray; |
||||
#endif |
||||
|
||||
/* DebugOutput, DebugMessage, DebugGroup used only statically */ |
||||
/* DefaultFramebuffer is available only through global instance */ |
||||
/* DimensionTraits forward declaration is not needed */ |
||||
|
||||
class Extension; |
||||
class Framebuffer; |
||||
|
||||
#if !defined(MAGNUM_TARGET_GLES2) && !defined(MAGNUM_TARGET_WEBGL) |
||||
enum class ImageFormat: GLenum; |
||||
enum class ImageAccess: GLenum; |
||||
#endif |
||||
|
||||
template<UnsignedInt> class Image; |
||||
typedef Image<1> Image1D; |
||||
typedef Image<2> Image2D; |
||||
typedef Image<3> Image3D; |
||||
|
||||
template<UnsignedInt> class CompressedImage; |
||||
typedef CompressedImage<1> CompressedImage1D; |
||||
typedef CompressedImage<2> CompressedImage2D; |
||||
typedef CompressedImage<3> CompressedImage3D; |
||||
|
||||
template<UnsignedInt> class ImageView; |
||||
typedef ImageView<1> ImageView1D; |
||||
typedef ImageView<2> ImageView2D; |
||||
typedef ImageView<3> ImageView3D; |
||||
|
||||
template<UnsignedInt> class CompressedImageView; |
||||
typedef CompressedImageView<1> CompressedImageView1D; |
||||
typedef CompressedImageView<2> CompressedImageView2D; |
||||
typedef CompressedImageView<3> CompressedImageView3D; |
||||
|
||||
enum class MeshPrimitive: GLenum; |
||||
|
||||
class Mesh; |
||||
class MeshView; |
||||
|
||||
#if !defined(MAGNUM_TARGET_GLES2) && !defined(MAGNUM_TARGET_WEBGL) |
||||
/* MultisampleTextureSampleLocations enum used only in the function */ |
||||
template<UnsignedInt> class MultisampleTexture; |
||||
typedef MultisampleTexture<2> MultisampleTexture2D; |
||||
typedef MultisampleTexture<3> MultisampleTexture2DArray; |
||||
#endif |
||||
|
||||
enum class PixelFormat: GLenum; |
||||
enum class PixelType: GLenum; |
||||
enum class CompressedPixelFormat: GLenum; |
||||
|
||||
class PixelStorage; |
||||
#ifndef MAGNUM_TARGET_GLES |
||||
class CompressedPixelStorage; |
||||
#endif |
||||
|
||||
/* ObjectFlag, ObjectFlags are used only in conjunction with *::wrap() function */ |
||||
|
||||
class PrimitiveQuery; |
||||
class SampleQuery; |
||||
class TimeQuery; |
||||
|
||||
#ifndef MAGNUM_TARGET_GLES |
||||
class RectangleTexture; |
||||
#endif |
||||
|
||||
class Renderbuffer; |
||||
enum class RenderbufferFormat: GLenum; |
||||
|
||||
class Sampler; |
||||
class Shader; |
||||
|
||||
template<UnsignedInt> class Texture; |
||||
#ifndef MAGNUM_TARGET_GLES |
||||
typedef Texture<1> Texture1D; |
||||
#endif |
||||
typedef Texture<2> Texture2D; |
||||
#if !(defined(MAGNUM_TARGET_WEBGL) && defined(MAGNUM_TARGET_GLES2)) |
||||
typedef Texture<3> Texture3D; |
||||
#endif |
||||
|
||||
#ifndef MAGNUM_TARGET_GLES2 |
||||
template<UnsignedInt> class TextureArray; |
||||
#ifndef MAGNUM_TARGET_GLES |
||||
typedef TextureArray<1> Texture1DArray; |
||||
#endif |
||||
typedef TextureArray<2> Texture2DArray; |
||||
#endif |
||||
|
||||
enum class TextureFormat: GLenum; |
||||
|
||||
#ifndef MAGNUM_TARGET_GLES2 |
||||
class TransformFeedback; |
||||
#endif |
||||
|
||||
enum class Version: Int; |
||||
#endif |
||||
|
||||
} |
||||
|
||||
#endif |
||||
|
||||
@ -1,10 +1,9 @@
|
||||
#include "TransformFeedbackState.h" |
||||
|
||||
#include "Magnum/Context.h" |
||||
#include "Magnum/Extensions.h" |
||||
#include "Magnum/TransformFeedback.h" |
||||
|
||||
#include "State.h" |
||||
#include "Magnum/GL/Context.h" |
||||
#include "Magnum/GL/Extensions.h" |
||||
#include "Magnum/GL/TransformFeedback.h" |
||||
#include "Magnum/GL/Implementation/State.h" |
||||
|
||||
namespace Magnum { namespace Implementation { |
||||
|
||||
@ -1,5 +1,5 @@
|
||||
#ifndef Magnum_OpenGL_h |
||||
#define Magnum_OpenGL_h |
||||
#ifndef Magnum_GL_OpenGL_h |
||||
#define Magnum_GL_OpenGL_h |
||||
/*
|
||||
This file is part of Magnum. |
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in new issue