Skip to content

Commit

Permalink
Replaced example files with larger CMake-based example.
Browse files Browse the repository at this point in the history
  • Loading branch information
ginkgo committed Aug 16, 2012
1 parent 05e1ea0 commit 76afd2f
Show file tree
Hide file tree
Showing 244 changed files with 52,085 additions and 1,096 deletions.
27 changes: 27 additions & 0 deletions examples/CMakeLists.txt
@@ -0,0 +1,27 @@

cmake_minimum_required(VERSION 2.8)
project(minimal)

find_package(PythonInterp REQUIRED)
find_package(OpenGL REQUIRED)

find_library(GLFW_LIBRARIES glfw)

include_directories("${PROJECT_BINARY_DIR}/generated")

add_custom_command(OUTPUT "${PROJECT_BINARY_DIR}/generated/flextGL.h" "${PROJECT_BINARY_DIR}/generated/flextGL.c"
COMMAND ${PYTHON_EXECUTABLE} "${PROJECT_SOURCE_DIR}/../flextGLgen.py" -Dgenerated -Tglfw ${PROJECT_SOURCE_DIR}/profile.txt
DEPENDS ${PROJECT_SOURCE_DIR}/profile.txt
${PROJECT_SOURCE_DIR}/../flextGLgen.py
${PROJECT_SOURCE_DIR}/../flext.py
${PROJECT_SOURCE_DIR}/../templates/glfw/flextGL.h.template
${PROJECT_SOURCE_DIR}/../templates/glfw/flextGL.c.template)


add_executable(minimal minimal.cpp mesh.cpp utility.cpp generated/flextGL.c)
target_link_libraries(minimal ${OPENGL_LIBRARIES} ${GLFW_LIBRARIES} ${GLEW_LIBRARIES})

add_custom_command(TARGET minimal COMMAND ${CMAKE_COMMAND} -E copy_if_different
"${PROJECT_SOURCE_DIR}/minimal.frag" $<TARGET_FILE_DIR:minimal>)
add_custom_command(TARGET minimal COMMAND ${CMAKE_COMMAND} -E copy_if_different
"${PROJECT_SOURCE_DIR}/minimal.vert" $<TARGET_FILE_DIR:minimal>)
29 changes: 29 additions & 0 deletions examples/common.hpp
@@ -0,0 +1,29 @@
#ifndef COMMON_HH
#define COMMON_HH

#include <flextGL.h>
#include <GL/glfw.h>

#include "glm/glm.hpp"
#include "glm/ext.hpp"


using glm::vec3;
using glm::mat3;
using glm::vec4;
using glm::mat4;

#include <iostream>
#include <string>
#include <cstdlib>

using std::string;
using std::cerr;
using std::cout;
using std::endl;

using std::exit;

#include "utility.hpp"

#endif
21 changes: 21 additions & 0 deletions examples/glm/copying.txt
@@ -0,0 +1,21 @@
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.

0 comments on commit 76afd2f

Please sign in to comment.