Commit e35d91aa authored by Robert Menzel's avatar Robert Menzel

added cmake file to include directly in case no lib of ACGL should get build,...

added cmake file to include directly in case no lib of ACGL should get build, fixed a normal creation bug
parent 1b5d5de4
#
# Use this to compile ACGL as a library. To include it statically compiled into
# your own project you can also just include the CMakeListsStaticInclude.txt:
# INCLUDE(${CMAKE_SOURCE_DIR}/CMakeListsStaticInclude.txt)
#
CMAKE_MINIMUM_REQUIRED (VERSION 2.6)
################################################################################
......@@ -15,7 +20,7 @@ INCLUDE(${CMAKE_SOURCE_DIR}/cmake/GlobalAndLocalExternACGL.txt)
# OpenGL Support
IF(NOT DEFINED ACGL_OPENGL_SUPPORT)
SET(ACGL_OPENGL_SUPPORT CORE_42 CACHE STRING "")
SET_PROPERTY(CACHE ACGL_OPENGL_SUPPORT PROPERTY STRINGS CORE_32 CORE_33 CORE_40 CORE_41 CORE_41_ES CORE_42 FULL_21 FULL_30 FULL_31 FULL_32 FULL_33 FULL_40 FULL_41 FULL_42 ES_20)
SET_PROPERTY(CACHE ACGL_OPENGL_SUPPORT PROPERTY STRINGS CORE_32 CORE_33 CORE_40 CORE_41 CORE_42 CORE_43 CORE_42 FULL_21 FULL_30 FULL_31 FULL_32 FULL_33 FULL_40 FULL_41 FULL_42 FULL_43 ES_20)
ENDIF()
# Error Level
......@@ -44,20 +49,11 @@ SET(LIBRARY_OUTPUT_PATH "${CMAKE_CURRENT_SOURCE_DIR}/lib")
# Project Files
################################################################################
# Find all used files of certain file-types
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")
#
# if ACGL should not get compiled as a library, just include the following file
# into the projects CMakeList.txt
#
INCLUDE(${CMAKE_SOURCE_DIR}/CMakeListsStaticInclude.txt)
################################################################################
# Defines
......@@ -79,19 +75,6 @@ IF(DEFINED ACGL_COMPILE_WITH_QT)
SET(LIBRARIES ${LIBRARIES} ${QT_LIBRARIES})
ENDIF()
# GLM
#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()
################################################################################
# Final Definition
################################################################################
......
#
# To build ACGL as a library, use the CMakeLists.txt
# To build it statically into a project just include this file,
# e.g.: INCLUDE(${CMAKE_SOURCE_DIR}/extern/acgl/CMakeListsStaticInclude.txt)
#
# Find all used files of certain file-types
FILE(GLOB_RECURSE SOURCE_FILES_C "${CMAKE_CURRENT_LIST_DIR}/src/*.c")
FILE(GLOB_RECURSE SOURCE_FILES_CC "${CMAKE_CURRENT_LIST_DIR}/src/*.cc")
FILE(GLOB_RECURSE SOURCE_FILES_CPP "${CMAKE_CURRENT_LIST_DIR}/src/*.cpp")
FILE(GLOB_RECURSE HEADER_FILES_H "${CMAKE_CURRENT_LIST_DIR}/include/*.h")
FILE(GLOB_RECURSE HEADER_FILES_HH "${CMAKE_CURRENT_LIST_DIR}/include/*.hh")
FILE(GLOB_RECURSE HEADER_FILES_HPP "${CMAKE_CURRENT_LIST_DIR}/include/*.hpp")
SET(HEADER_FILES ${HEADER_FILES} ${HEADER_FILES_H} ${HEADER_FILES_HH} ${HEADER_FILES_HPP})
SET(SOURCE_FILES ${SOURCE_FILES} ${SOURCE_FILES_C} ${SOURCE_FILES_CC} ${SOURCE_FILES_CPP})
INCLUDE_DIRECTORIES(${CMAKE_CURRENT_LIST_DIR}/include)
cmake @ d68c5f45
Subproject commit c82510d12c5f5c6d94696193163e838afc7db4ab
Subproject commit d68c5f4579f5f94ad7ef455e49aae35797ce36df
......@@ -30,15 +30,10 @@ protected:
//! Constructor is protected => singleton.
Settings()
: mResourcePath (""),
mTexturePath ("Texture/"),
mGeometryPath ("Geometry/"),
mShaderPath ("Shader/")
mTexturePath (""),
mGeometryPath (""),
mShaderPath ("")
{
# if defined(ACGL_OPENGL_VERSION_21)
// use an alternative path if compiled for old OpenGL
mShaderPath = "Shader21/";
ACGL::Utils::message() << "compiled for OpenGL 2.1: using alternative shader folder Shader21/" << std::endl;
# endif
}
public:
......
......@@ -16,9 +16,10 @@
*
*
* This wrapper can get configured with external defines:
* ACGL_OPENGL_PROFILE_CORE : CORE: if possible include/load only core OpenGL functions
* FULL: support for CORE and deprecated functions
* ACGL_OPENGL_PROFILE_CORE : if defined: if possible include/load only core OpenGL functions
* if not defined: support for CORE and deprecated functions
* (NOTE: the OpenGL context itself is not created by ACGL!)
* ACGL_OPENGL_ES : if defined: assume OpenGL ES (2.0 or 3.0)
* ACGL_OPENGL_VERSION_41 : (or other versions): minimal OpenGL version that can be assumed to be present.
* The app can't run on older contexts and will probably terminate at startup.
* Set this to a low version and it will run on lost machines
......@@ -28,7 +29,6 @@
* functions of the latest GL version are loaded (if available) and the header
* of the latest version gets included. ACGL however will only assume the version
* set by ACGL_OPENGL_VERSION_XY to be present.
* ACGL_PLATFORM_DESKTOP : DESKTOP vs. MOBILE plattform = GL vs. GL ES
*
* ACGL_USE_GLEW : if this is set, GLEW gets used to load the GL functions,
* otherwise an internal GL loader based on glLoadGen gets used on desktop systems.
......
......@@ -87,7 +87,7 @@ inline bool ACGL_ARB_compute_shader() {
#endif
}
// anisotrophic texture filtering
// ARB debug output
inline bool ACGL_ARB_debug_output() {
#ifdef ACGL_EXTENSION_LOADER_GLLOADGEN
return (ogl_ext_ARB_debug_output != ogl_LOAD_FAILED);
......
......@@ -40,6 +40,10 @@ SharedShaderProgram ShaderProgramControlFiles::create(void)
SharedShaderProgram shaderProgram(new ShaderProgram());
std::vector<std::string>::size_type numberOfFiles = mFileNames.size();
if (numberOfFiles == 0) {
Utils::error() << "Can't create ShaderProgram from 0 files!" << std::endl;
return SharedShaderProgram();
}
// some of the files have correct types already, some not yet -> try to guess the rest
for (std::vector<std::string>::size_type file = 0; file < numberOfFiles; ++file) {
......
......@@ -273,9 +273,14 @@ SharedGeometryData loadGeometryDataFromOBJ(const std::string& _filename, bool _c
}
else
{
debug() << "model has no normals, computing face normals" << std::endl;
hasNormals = true;
}
}
if (hasNormals) {
// if the model has normals defined, no face normals have to get computed
_computeNormals = false;
}
// all data are read from the file. construct an ArrayBuffer from the data
data = SharedGeometryData(new GeometryData());
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment