Commit 6ea55778 authored by Robert Menzel's avatar Robert Menzel

integrated lodepng and glm

parent 23830adb
......@@ -45,8 +45,16 @@ SET(LIBRARY_OUTPUT_PATH "${CMAKE_CURRENT_SOURCE_DIR}/lib")
################################################################################
# Find all used files of certain file-types
FILE(GLOB_RECURSE SOURCE_FILES "${CMAKE_CURRENT_SOURCE_DIR}/src/*.cc")
FILE(GLOB_RECURSE HEADER_FILES "${CMAKE_CURRENT_SOURCE_DIR}/include/*.hh")
FILE(GLOB_RECURSE SOURCE_FILES_C "${CMAKE_CURRENT_SOURCE_DIR}/src/*.c")
FILE(GLOB_RECURSE SOURCE_FILES_CC "${CMAKE_CURRENT_SOURCE_DIR}/src/*.cc")
FILE(GLOB_RECURSE SOURCE_FILES_CPP "${CMAKE_CURRENT_SOURCE_DIR}/src/*.cpp")
FILE(GLOB_RECURSE HEADER_FILES_H "${CMAKE_CURRENT_SOURCE_DIR}/include/*.h")
FILE(GLOB_RECURSE HEADER_FILES_HH "${CMAKE_CURRENT_SOURCE_DIR}/include/*.hh")
FILE(GLOB_RECURSE HEADER_FILES_HPP "${CMAKE_CURRENT_SOURCE_DIR}/include/*.hpp")
SET(HEADER_FILES ${HEADER_FILES_H} ${HEADER_FILES_HH} ${HEADER_FILES_HPP})
SET(SOURCE_FILES ${SOURCE_FILES_C} ${SOURCE_FILES_CC} ${SOURCE_FILES_CPP})
# Add ACGL to the include path
INCLUDE_DIRECTORIES("${CMAKE_CURRENT_SOURCE_DIR}/include")
......@@ -76,13 +84,13 @@ FIND_PACKAGE(GLM REQUIRED)
INCLUDE_DIRECTORIES(${GLM_INCLUDE_DIR})
# GLEW
IF(DEFINED ACGL_PLATFORM_DESKTOP)
#MESSAGE("GLEW")
FIND_PACKAGE(GLEW REQUIRED)
ADD_DEFINITIONS(${GLEW_DEFINES})
INCLUDE_DIRECTORIES(${GLEW_INCLUDE_DIR})
SET(LIBRARIES ${LIBRARIES} ${GLEW_LIBRARIES})
ENDIF()
#IF(DEFINED ACGL_PLATFORM_DESKTOP)
# #MESSAGE("GLEW")
# FIND_PACKAGE(GLEW REQUIRED)
# ADD_DEFINITIONS(${GLEW_DEFINES})
# INCLUDE_DIRECTORIES(${GLEW_INCLUDE_DIR})
# SET(LIBRARIES ${LIBRARIES} ${GLEW_LIBRARIES})
#ENDIF()
################################################################################
# Final Definition
......
......@@ -3,5 +3,11 @@ ACGL - Aachen Computer Graphics Library
Intended to speed up graphics/OpenGL prototyping. Developed by Lars Krecklau and Robert Menzel with help from Andreas Neu, Janis Born, Kersten Schuster, Ole Untzelmann, based on prior work from Lars Krecklau.
Included third-party software:
* Includes lodepng by Lode Vandevenne, unchanged except for the include path in lodepng.cpp. lodepng is provided as-is, see license text in the lodepng source code.
* Includes OpenGL loader code created by a modified glLoadGen by Jason McKesson.
* Includes GLM by Christophe Riccio.
See LICENSE.TXT for licensing information.
......@@ -4,12 +4,12 @@
* Distributed under the terms of the MIT License (see LICENSE.TXT). *
**********************************************************************/
#ifndef ACGL_OPENGL_DATA_TEXTUREDATAPPMWRITER_HH
#define ACGL_OPENGL_DATA_TEXTUREDATAPPMWRITER_HH
#ifndef ACGL_OPENGL_DATA_TEXTUREDATALOADSTORE_HH
#define ACGL_OPENGL_DATA_TEXTUREDATALOADSTORE_HH
/**
* Helper function for writing the contents of a TextureData object into a PPM file.
* Expects 8 bit RGB texture data (as can be provided by Texture::getImageData)
* Helper function for writing the contents of a TextureData object into a file
* and loading them from a file.
*/
#include <ACGL/ACGL.hh>
......@@ -25,4 +25,4 @@ bool saveTextureDataToPPM(const ConstSharedTextureData& _textureData, const std:
} // OpenGL
} // ACGL
#endif // ACGL_OPENGL_DATA_TEXTUREDATAPPMWRITER_HH
#endif // ACGL_OPENGL_DATA_TEXTUREDATALOADSTORE_HH
......@@ -87,6 +87,17 @@ inline bool ACGL_ARB_compute_shader() {
#endif
}
// anisotrophic texture filtering
inline bool ACGL_ARB_debug_output() {
#ifdef ACGL_EXTENSION_LOADER_GLLOADGEN
return (ogl_ext_ARB_debug_output != ogl_LOAD_FAILED);
#elif ACGL_USE_GLEW
return GLEW_ARB_debug_output;
#else
return false;
#endif
}
} // OpenGL
} // ACGL
......
set(NAME glm)
file(GLOB ROOT_SOURCE *.cpp)
file(GLOB ROOT_INLINE *.inl)
file(GLOB ROOT_HEADER *.hpp)
file(GLOB_RECURSE CORE_SOURCE ./core/*.cpp)
file(GLOB_RECURSE CORE_INLINE ./core/*.inl)
file(GLOB_RECURSE CORE_HEADER ./core/*.hpp)
file(GLOB_RECURSE GTC_SOURCE ./gtc/*.cpp)
file(GLOB_RECURSE GTC_INLINE ./gtc/*.inl)
file(GLOB_RECURSE GTC_HEADER ./gtc/*.hpp)
file(GLOB_RECURSE GTX_SOURCE ./gtx/*.cpp)
file(GLOB_RECURSE GTX_INLINE ./gtx/*.inl)
file(GLOB_RECURSE GTX_HEADER ./gtx/*.hpp)
file(GLOB_RECURSE VIRTREV_SOURCE ./virtrev/*.cpp)
file(GLOB_RECURSE VIRTREV_INLINE ./virtrev/*.inl)
file(GLOB_RECURSE VIRTREV_HEADER ./virtrev/*.hpp)
source_group("Core Files" FILES ${CORE_SOURCE})
source_group("Core Files" FILES ${CORE_INLINE})
source_group("Core Files" FILES ${CORE_HEADER})
source_group("GTC Files" FILES ${GTC_SOURCE})
source_group("GTC Files" FILES ${GTC_INLINE})
source_group("GTC Files" FILES ${GTC_HEADER})
source_group("GTX Files" FILES ${GTX_SOURCE})
source_group("GTX Files" FILES ${GTX_INLINE})
source_group("GTX Files" FILES ${GTX_HEADER})
source_group("VIRTREV Files" FILES ${VIRTREV_SOURCE})
source_group("VIRTREV Files" FILES ${VIRTREV_INLINE})
source_group("VIRTREV Files" FILES ${VIRTREV_HEADER})
include_directories(${CMAKE_CURRENT_SOURCE_DIR}/..)
add_executable(${NAME}
${ROOT_SOURCE} ${ROOT_INLINE} ${ROOT_HEADER}
${CORE_SOURCE} ${CORE_INLINE} ${CORE_HEADER}
${GTC_SOURCE} ${GTC_INLINE} ${GTC_HEADER}
${GTX_SOURCE} ${GTX_INLINE} ${GTX_HEADER}
${VIRTREV_SOURCE} ${VIRTREV_INLINE} ${VIRTREV_HEADER})
The MIT License
Copyright (c) 2005 - 2012 G-Truc Creation
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.
///////////////////////////////////////////////////////////////////////////////////
/// OpenGL Mathematics (glm.g-truc.net)
///
/// Copyright (c) 2005 - 2012 G-Truc Creation (www.g-truc.net)
/// 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.
///
/// @ref core
/// @file glm/core/_detail.hpp
/// @date 2008-07-24 / 2011-06-14
/// @author Christophe Riccio
///////////////////////////////////////////////////////////////////////////////////
#ifndef glm_core_detail
#define glm_core_detail
#include "setup.hpp"
#include <cassert>
#if(defined(__STDC_VERSION__) && (__STDC_VERSION__ >= 199901L))
#include <cstdint>
#endif
namespace glm{
namespace detail
{
class half;
#if(defined(__STDC_VERSION__) && (__STDC_VERSION__ >= 199901L)) // C99 detected, 64 bit types available
typedef int64_t sint64;
typedef uint64_t uint64;
#elif(GLM_COMPILER & GLM_COMPILER_VC)
typedef signed __int64 sint64;
typedef unsigned __int64 uint64;
#elif(GLM_COMPILER & (GLM_COMPILER_GCC | GLM_COMPILER_LLVM_GCC | GLM_COMPILER_CLANG))
__extension__ typedef signed long long sint64;
__extension__ typedef unsigned long long uint64;
#elif(GLM_COMPILER & GLM_COMPILER_BC)
typedef Int64 sint64;
typedef Uint64 uint64;
#else//unknown compiler
typedef signed long long sint64;
typedef unsigned long long uint64;
#endif//GLM_COMPILER
template<bool C>
struct If
{
template<typename F, typename T>
static GLM_FUNC_QUALIFIER T apply(F functor, const T& val)
{
return functor(val);
}
};
template<>
struct If<false>
{
template<typename F, typename T>
static GLM_FUNC_QUALIFIER T apply(F, const T& val)
{
return val;
}
};
//template <typename T>
//struct traits
//{
// static const bool is_signed = false;
// static const bool is_float = false;
// static const bool is_vector = false;
// static const bool is_matrix = false;
// static const bool is_genType = false;
// static const bool is_genIType = false;
// static const bool is_genUType = false;
//};
//template <>
//struct traits<half>
//{
// static const bool is_float = true;
// static const bool is_genType = true;
//};
//template <>
//struct traits<float>
//{
// static const bool is_float = true;
// static const bool is_genType = true;
//};
//template <>
//struct traits<double>
//{
// static const bool is_float = true;
// static const bool is_genType = true;
//};
//template <typename genType>
//struct desc
//{
// typedef genType type;
// typedef genType * pointer;
// typedef genType const* const_pointer;
// typedef genType const *const const_pointer_const;
// typedef genType *const pointer_const;
// typedef genType & reference;
// typedef genType const& const_reference;
// typedef genType const& param_type;
// typedef typename genType::value_type value_type;
// typedef typename genType::size_type size_type;
// static const typename size_type value_size;
//};
//template <typename genType>
//const typename desc<genType>::size_type desc<genType>::value_size = genType::value_size();
union uif32
{
GLM_FUNC_QUALIFIER uif32() :
i(0)
{}
GLM_FUNC_QUALIFIER uif32(float f) :
f(f)
{}
GLM_FUNC_QUALIFIER uif32(unsigned int i) :
i(i)
{}
float f;
unsigned int i;
};
union uif64
{
GLM_FUNC_QUALIFIER uif64() :
i(0)
{}
GLM_FUNC_QUALIFIER uif64(double f) :
f(f)
{}
GLM_FUNC_QUALIFIER uif64(uint64 i) :
i(i)
{}
double f;
uint64 i;
};
typedef uif32 uif;
//////////////////
// int
template <typename T>
struct is_int
{
enum is_int_enum
{
_YES = 0,
_NO = 1
};
};
#define GLM_DETAIL_IS_INT(T) \
template <> \
struct is_int<T> \
{ \
enum is_int_enum \
{ \
_YES = 1, \
_NO = 0 \
}; \
}
//////////////////
// uint
template <typename T>
struct is_uint
{
enum is_uint_enum
{
_YES = 0,
_NO = 1
};
};
#define GLM_DETAIL_IS_UINT(T) \
template <> \
struct is_uint<T> \
{ \
enum is_uint_enum \
{ \
_YES = 1, \
_NO = 0 \
}; \
}
//GLM_DETAIL_IS_UINT(unsigned long long)
//////////////////
// float
template <typename T>
struct is_float
{
enum is_float_enum
{
_YES = 0,
_NO = 1
};
};
#define GLM_DETAIL_IS_FLOAT(T) \
template <> \
struct is_float<T> \
{ \
enum is_float_enum \
{ \
_YES = 1, \
_NO = 0 \
}; \
}
GLM_DETAIL_IS_FLOAT(detail::half);
GLM_DETAIL_IS_FLOAT(float);
GLM_DETAIL_IS_FLOAT(double);
GLM_DETAIL_IS_FLOAT(long double);
//////////////////
// bool
template <typename T>
struct is_bool
{
enum is_bool_enum
{
_YES = 0,
_NO = 1
};
};
template <>
struct is_bool<bool>
{
enum is_bool_enum
{
_YES = 1,
_NO = 0
};
};
//////////////////
// vector
template <typename T>
struct is_vector
{
enum is_vector_enum
{
_YES = 0,
_NO = 1
};
};
# define GLM_DETAIL_IS_VECTOR(TYPE) \
template <typename T> \
struct is_vector<TYPE<T> > \
{ \
enum is_vector_enum \
{ \
_YES = 1, \
_NO = 0 \
}; \
}
//////////////////
// matrix
template <typename T>
struct is_matrix
{
enum is_matrix_enum
{
_YES = 0,
_NO = 1
};
};
#define GLM_DETAIL_IS_MATRIX(T) \
template <> \
struct is_matrix \
{ \
enum is_matrix_enum \
{ \
_YES = 1, \
_NO = 0 \
}; \
}
//////////////////
// type
template <typename T>
struct type
{
enum type_enum
{
is_float = is_float<T>::_YES,
is_int = is_int<T>::_YES,
is_uint = is_uint<T>::_YES,
is_bool = is_bool<T>::_YES
};
};
//////////////////
// type
typedef signed char int8;
typedef signed short int16;
typedef signed int int32;
typedef detail::sint64 int64;
typedef unsigned char uint8;
typedef unsigned short uint16;
typedef unsigned int uint32;
typedef detail::uint64 uint64;
typedef detail::half float16;
typedef float float32;
typedef double float64;
//////////////////
// float_or_int_trait
struct float_or_int_value
{
enum
{
GLM_ERROR,
GLM_FLOAT,
GLM_INT
};
};
template <typename T>
struct float_or_int_trait
{
enum{ID = float_or_int_value::GLM_ERROR};
};
template <>
struct float_or_int_trait<int8>
{
enum{ID = float_or_int_value::GLM_INT};
};
template <>
struct float_or_int_trait<int16>
{
enum{ID = float_or_int_value::GLM_INT};
};
template <>
struct float_or_int_trait<int32>
{
enum{ID = float_or_int_value::GLM_INT};
};
template <>
struct float_or_int_trait<int64>
{
enum{ID = float_or_int_value::GLM_INT};
};
template <>
struct float_or_int_trait<uint8>