diff --git a/CMakeLists.txt b/CMakeLists.txt index 4821a5024..20f652e87 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -1,7 +1,6 @@ cmake_minimum_required(VERSION 2.6) project(Magnum) -option(BUILD_EXAMPLES "Build examples (requires GLUT)." OFF) option(BUILD_TESTS "Build unit tests (requires Qt4)." OFF) if(BUILD_TESTS) @@ -13,7 +12,6 @@ if(BUILD_TESTS) else() enable_testing() endif() - endif() set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} "${Magnum_SOURCE_DIR}/modules/") @@ -21,28 +19,11 @@ include(MagnumMacros) set_parent_scope(MAGNUM_INCLUDE_DIR "${CMAKE_CURRENT_SOURCE_DIR}/src") set_parent_scope(MAGNUM_LIBRARY Magnum) - include(FindMagnum) -set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wall -pedantic -std=c++0x") - add_subdirectory(modules) add_subdirectory(src) install(DIRECTORY src/ DESTINATION ${MAGNUM_INCLUDE_INSTALL_DIR} FILES_MATCHING PATTERN "*.h" PATTERN "*/Test" EXCLUDE) - -include_directories(${CMAKE_CURRENT_SOURCE_DIR}/src) - -if(BUILD_EXAMPLES) - find_package(GLUT) - - if(NOT GLUT_FOUND) - message(WARNING "GLUT is required for building examples. No examples will be build.") - set(BUILD_EXAMPLES OFF) - else() - add_subdirectory(examples) - endif() - -endif() diff --git a/examples/CMakeLists.txt b/examples/CMakeLists.txt deleted file mode 100644 index c1594aeb9..000000000 --- a/examples/CMakeLists.txt +++ /dev/null @@ -1,2 +0,0 @@ -add_subdirectory(texturedTriangle) -add_subdirectory(triangle) diff --git a/examples/texturedTriangle/CMakeLists.txt b/examples/texturedTriangle/CMakeLists.txt deleted file mode 100644 index 79fc3e8b2..000000000 --- a/examples/texturedTriangle/CMakeLists.txt +++ /dev/null @@ -1,2 +0,0 @@ -add_executable(texturedTriangleExample main.cpp TexturedIdentityShader.cpp TexturedTriangle.cpp TGATexture.cpp) -target_link_libraries(texturedTriangleExample Magnum ${GLUT_LIBRARY}) diff --git a/examples/texturedTriangle/TGATexture.cpp b/examples/texturedTriangle/TGATexture.cpp deleted file mode 100644 index 19af8e233..000000000 --- a/examples/texturedTriangle/TGATexture.cpp +++ /dev/null @@ -1,64 +0,0 @@ -/* - Copyright © 2010, 2011 Vladimír Vondruš - - This file is part of Magnum. - - Magnum is free software: you can redistribute it and/or modify - it under the terms of the GNU Lesser General Public License version 3 - only, as published by the Free Software Foundation. - - Magnum is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU Lesser General Public License version 3 for more details. -*/ - -#include "TGATexture.h" - -#include -#include - -using namespace std; -using namespace Magnum::Math; - -namespace Magnum { namespace Examples { - -TGATexture::TGATexture(const std::string& filename) { - ifstream image(filename.c_str(), ifstream::binary); - if(!image.good()) { - image.close(); - return; - } - - Header header; - image.read(reinterpret_cast(&header), sizeof(Header)); - - ColorFormat colorFormat; - int internalFormat; - - switch(header.bpp) { - case 24: - colorFormat = BGR; - internalFormat = RGB; - break; - case 32: - colorFormat = BGRA; - internalFormat = RGBA; - break; - default: - cerr << (int) header.bpp << endl; - return; - } - - size_t size = header.width*header.height*header.bpp/8; - GLubyte* buffer = new GLubyte[size]; - image.read(reinterpret_cast(buffer), size); - image.close(); - - GLsizei dimensions[] = {header.width, header.height}; - - setData(0, internalFormat, dimensions, colorFormat, buffer); - delete[] buffer; -} - -}} diff --git a/examples/texturedTriangle/TGATexture.h b/examples/texturedTriangle/TGATexture.h deleted file mode 100644 index b7313382a..000000000 --- a/examples/texturedTriangle/TGATexture.h +++ /dev/null @@ -1,49 +0,0 @@ -#ifndef Magnum_Examples_TGATexture_h -#define Magnum_Examples_TGATexture_h -/* - Copyright © 2010, 2011 Vladimír Vondruš - - This file is part of Magnum. - - Magnum is free software: you can redistribute it and/or modify - it under the terms of the GNU Lesser General Public License version 3 - only, as published by the Free Software Foundation. - - Magnum is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU Lesser General Public License version 3 for more details. -*/ - -#include "Texture.h" - -#include - -namespace Magnum { namespace Examples { - -class TGATexture: public Texture2D { - public: - TGATexture(const std::string& filename); - - private: - #pragma pack(1) - struct Header { - GLbyte identsize; /**< @brief Size of ID field that follows header (0) */ - GLbyte colorMapType; /**< @brief 0 = None, 1 = paletted */ - GLbyte imageType; /**< @brief 0 = none, 1 = indexed, 2 = rgb, 3 = grey, +8=rle */ - unsigned short colorMapStart; /**< @brief First color map entry */ - unsigned short colorMapLength; /**< @brief Number of colors */ - unsigned char colorMapBpp; /**< @brief Bits per palette entry */ - unsigned short beginX; /**< @brief Image x origin */ - unsigned short beginY; /**< @brief Image y origin */ - unsigned short width; /**< @brief Image width */ - unsigned short height; /**< @brief Image height */ - GLbyte bpp; /**< @brief Bits per pixel (8 16, 24, 32) */ - GLbyte descriptor; /**< @brief Image descriptor */ - }; - #pragma pack(8) -}; - -}} - -#endif diff --git a/examples/texturedTriangle/TexturedIdentityShader.cpp b/examples/texturedTriangle/TexturedIdentityShader.cpp deleted file mode 100644 index b0248abe3..000000000 --- a/examples/texturedTriangle/TexturedIdentityShader.cpp +++ /dev/null @@ -1,38 +0,0 @@ -/* - Copyright © 2010, 2011 Vladimír Vondruš - - This file is part of Magnum. - - Magnum is free software: you can redistribute it and/or modify - it under the terms of the GNU Lesser General Public License version 3 - only, as published by the Free Software Foundation. - - Magnum is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU Lesser General Public License version 3 for more details. -*/ - -#include "TexturedIdentityShader.h" - -namespace Magnum { namespace Examples { - -TexturedIdentityShader::TexturedIdentityShader() { - Shader* vertexShader = Shader::fromFile(Shader::Vertex, "TexturedIdentityShader.vert"); - Shader* fragmentShader = Shader::fromFile(Shader::Fragment, "TexturedIdentityShader.frag"); - - attachShader(vertexShader); - attachShader(fragmentShader); - - bindAttribute(Vertex, "vertex"); - bindAttribute(TextureCoordinates, "textureCoordinates"); - - link(); - - textureUniform = uniformLocation("textureData"); - - delete vertexShader; - delete fragmentShader; -} - -}} diff --git a/examples/texturedTriangle/TexturedIdentityShader.frag b/examples/texturedTriangle/TexturedIdentityShader.frag deleted file mode 100644 index 6bae9c534..000000000 --- a/examples/texturedTriangle/TexturedIdentityShader.frag +++ /dev/null @@ -1,11 +0,0 @@ -#version 330 - -uniform sampler2D textureData; - -in vec2 varyingTextureCoordinates; - -out vec4 fragmentColor; - -void main() { - fragmentColor = texture(textureData, varyingTextureCoordinates); -} diff --git a/examples/texturedTriangle/TexturedIdentityShader.h b/examples/texturedTriangle/TexturedIdentityShader.h deleted file mode 100644 index c19c9ab86..000000000 --- a/examples/texturedTriangle/TexturedIdentityShader.h +++ /dev/null @@ -1,41 +0,0 @@ -#ifndef Magnum_Examples_TexturedIdentityShader_h -#define Magnum_Examples_TexturedIdentityShader_h -/* - Copyright © 2010, 2011 Vladimír Vondruš - - This file is part of Magnum. - - Magnum is free software: you can redistribute it and/or modify - it under the terms of the GNU Lesser General Public License version 3 - only, as published by the Free Software Foundation. - - Magnum is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU Lesser General Public License version 3 for more details. -*/ - -#include "AbstractShaderProgram.h" - -namespace Magnum { namespace Examples { - -class TexturedIdentityShader: public AbstractShaderProgram { - public: - enum Attributes { - Vertex = 1, - TextureCoordinates = 2 - }; - - TexturedIdentityShader(); - - inline void setTextureUniform(GLuint level) { - setUniform(textureUniform, level); - } - - private: - GLint textureUniform; -}; - -}} - -#endif diff --git a/examples/texturedTriangle/TexturedIdentityShader.vert b/examples/texturedTriangle/TexturedIdentityShader.vert deleted file mode 100644 index c1f665baa..000000000 --- a/examples/texturedTriangle/TexturedIdentityShader.vert +++ /dev/null @@ -1,12 +0,0 @@ -#version 330 - -in vec4 vertex; -in vec2 textureCoordinates; - -out vec2 varyingTextureCoordinates; - -void main() { - varyingTextureCoordinates = textureCoordinates; - - gl_Position = vertex; -} diff --git a/examples/texturedTriangle/TexturedTriangle.cpp b/examples/texturedTriangle/TexturedTriangle.cpp deleted file mode 100644 index 53bb15c58..000000000 --- a/examples/texturedTriangle/TexturedTriangle.cpp +++ /dev/null @@ -1,51 +0,0 @@ -/* - Copyright © 2010, 2011 Vladimír Vondruš - - This file is part of Magnum. - - Magnum is free software: you can redistribute it and/or modify - it under the terms of the GNU Lesser General Public License version 3 - only, as published by the Free Software Foundation. - - Magnum is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU Lesser General Public License version 3 for more details. -*/ - -#include "TexturedTriangle.h" - -#include "Buffer.h" - -namespace Magnum { namespace Examples { - -TexturedTriangle::TexturedTriangle(const std::string& textureFilename, Object* parent): Object(parent), mesh(Mesh::Triangles, 3), texture(textureFilename) { - /* Vertices and texture coordinates, interleaved */ - GLfloat data[] = { - -0.5f, -0.5f, 0.0f, 1.0f, 0.0f, 0.0f, /* Lower left vertex */ - 0.5f, -0.5f, 0.0f, 1.0f, 1.0f, 0.0f, /* Lower right vertex */ - 0.0f, 0.5f, 0.0f, 1.0f, 0.5f, 1.0f, /* Top vertex */ - }; - - /* Fill the mesh with data */ - Buffer* buffer = mesh.addBuffer(true); - buffer->setData(sizeof(data), data, Buffer::DrawStatic); - - /* Bind attributes (first vertex data, then color data) */ - mesh.bindAttribute(buffer, TexturedIdentityShader::Vertex); - mesh.bindAttribute(buffer, TexturedIdentityShader::TextureCoordinates); - - /* Texture */ - texture.setMagnificationFilter(TGATexture::Linear); - texture.setMinificationFilter(TGATexture::Linear); - texture.setWrapping(Math::Vector2(TGATexture::ClampToEdge, TGATexture::ClampToEdge)); -} - -void TexturedTriangle::draw(const Matrix4& transformationMatrix, const Matrix4& projectionMatrix) { - texture.bind(); - shader.use(); - shader.setTextureUniform(0); - mesh.draw(); -} - -}} diff --git a/examples/texturedTriangle/TexturedTriangle.h b/examples/texturedTriangle/TexturedTriangle.h deleted file mode 100644 index 0ccdc1b1d..000000000 --- a/examples/texturedTriangle/TexturedTriangle.h +++ /dev/null @@ -1,39 +0,0 @@ -#ifndef Magnum_Examples_TexturedTriangle_h -#define Magnum_Examples_TexturedTriangle_h -/* - Copyright © 2010, 2011 Vladimír Vondruš - - This file is part of Magnum. - - Magnum is free software: you can redistribute it and/or modify - it under the terms of the GNU Lesser General Public License version 3 - only, as published by the Free Software Foundation. - - Magnum is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU Lesser General Public License version 3 for more details. -*/ - -#include "Object.h" -#include "Mesh.h" -#include "TexturedIdentityShader.h" -#include "TGATexture.h" - -namespace Magnum { namespace Examples { - -class TexturedTriangle: public Object { - public: - TexturedTriangle(const std::string& textureFilename, Object* parent = 0); - - virtual void draw(const Matrix4& transformationMatrix, const Matrix4& projectionMatrix); - - private: - Mesh mesh; - TexturedIdentityShader shader; - TGATexture texture; -}; - -}} - -#endif diff --git a/examples/texturedTriangle/main.cpp b/examples/texturedTriangle/main.cpp deleted file mode 100644 index 6a71d8599..000000000 --- a/examples/texturedTriangle/main.cpp +++ /dev/null @@ -1,63 +0,0 @@ -/* - Copyright © 2010, 2011 Vladimír Vondruš - - This file is part of Magnum. - - Magnum is free software: you can redistribute it and/or modify - it under the terms of the GNU Lesser General Public License version 3 - only, as published by the Free Software Foundation. - - Magnum is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU Lesser General Public License version 3 for more details. -*/ - -#include -#include -#include - -#include "Scene.h" -#include "TexturedTriangle.h" - -Magnum::Scene* s; - -/* Wrapper functions so GLUT can handle that */ -void setViewport(int w, int h) { - s->setViewport(w, h); -} -void draw() { - s->draw(); - glutSwapBuffers(); -} - -int main(int argc, char** argv) { - /* Init GLUT */ - glutInit(&argc, argv); - glutInitDisplayMode(GLUT_DOUBLE|GLUT_RGBA|GLUT_DEPTH|GLUT_STENCIL); - glutInitWindowSize(800, 600); - glutCreateWindow("Shaded TexturedTriangle example"); - glutReshapeFunc(setViewport); - glutDisplayFunc(draw); - - /* Init GLEW */ - GLenum err = glewInit(); - if(err != GLEW_OK) { - std::cerr << "GLEW error:" << glewGetErrorString(err) << std::endl; - return 1; - } - - /* Initialize scene */ - Magnum::Scene scene; - s = &scene; - - /* Every scene needs a camera */ - scene.setCamera(new Magnum::Camera(&scene)); - - /* Add triangle to the scene */ - new Magnum::Examples::TexturedTriangle("stone.tga", &scene); - - /* Main loop calls draw() periodically and setViewport() on window size change */ - glutMainLoop(); - return 0; -} diff --git a/examples/texturedTriangle/stone.tga b/examples/texturedTriangle/stone.tga deleted file mode 100644 index 4b30cd578..000000000 Binary files a/examples/texturedTriangle/stone.tga and /dev/null differ diff --git a/examples/triangle/CMakeLists.txt b/examples/triangle/CMakeLists.txt deleted file mode 100644 index 6cf10b04c..000000000 --- a/examples/triangle/CMakeLists.txt +++ /dev/null @@ -1,2 +0,0 @@ -add_executable(triangleExample main.cpp IdentityShader.cpp Triangle.cpp) -target_link_libraries(triangleExample Magnum ${GLUT_LIBRARY}) diff --git a/examples/triangle/IdentityShader.cpp b/examples/triangle/IdentityShader.cpp deleted file mode 100644 index e5db3396a..000000000 --- a/examples/triangle/IdentityShader.cpp +++ /dev/null @@ -1,36 +0,0 @@ -/* - Copyright © 2010, 2011 Vladimír Vondruš - - This file is part of Magnum. - - Magnum is free software: you can redistribute it and/or modify - it under the terms of the GNU Lesser General Public License version 3 - only, as published by the Free Software Foundation. - - Magnum is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU Lesser General Public License version 3 for more details. -*/ - -#include "IdentityShader.h" - -namespace Magnum { namespace Examples { - -IdentityShader::IdentityShader() { - Shader* vertexShader = Shader::fromFile(Shader::Vertex, "IdentityShader.vert"); - Shader* fragmentShader = Shader::fromFile(Shader::Fragment, "IdentityShader.frag"); - - attachShader(vertexShader); - attachShader(fragmentShader); - - bindAttribute(Vertex, "vertex"); - bindAttribute(Color, "color"); - - link(); - - delete vertexShader; - delete fragmentShader; -} - -}} diff --git a/examples/triangle/IdentityShader.frag b/examples/triangle/IdentityShader.frag deleted file mode 100644 index cf382b2a1..000000000 --- a/examples/triangle/IdentityShader.frag +++ /dev/null @@ -1,9 +0,0 @@ -#version 330 - -in vec4 varyingColor; - -out vec4 fragmentColor; - -void main() { - fragmentColor = varyingColor; -} diff --git a/examples/triangle/IdentityShader.h b/examples/triangle/IdentityShader.h deleted file mode 100644 index 8fe36951e..000000000 --- a/examples/triangle/IdentityShader.h +++ /dev/null @@ -1,34 +0,0 @@ -#ifndef Magnum_Examples_IdentityShader_h -#define Magnum_Examples_IdentityShader_h -/* - Copyright © 2010, 2011 Vladimír Vondruš - - This file is part of Magnum. - - Magnum is free software: you can redistribute it and/or modify - it under the terms of the GNU Lesser General Public License version 3 - only, as published by the Free Software Foundation. - - Magnum is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU Lesser General Public License version 3 for more details. -*/ - -#include "AbstractShaderProgram.h" - -namespace Magnum { namespace Examples { - -class IdentityShader: public AbstractShaderProgram { - public: - enum Attributes { - Vertex = 1, - Color = 2 - }; - - IdentityShader(); -}; - -}} - -#endif diff --git a/examples/triangle/IdentityShader.vert b/examples/triangle/IdentityShader.vert deleted file mode 100644 index e103ffb8e..000000000 --- a/examples/triangle/IdentityShader.vert +++ /dev/null @@ -1,12 +0,0 @@ -#version 330 - -in vec4 vertex; -in vec4 color; - -out vec4 varyingColor; - -void main() { - varyingColor = color; - - gl_Position = vertex; -} diff --git a/examples/triangle/Triangle.cpp b/examples/triangle/Triangle.cpp deleted file mode 100644 index 70101d664..000000000 --- a/examples/triangle/Triangle.cpp +++ /dev/null @@ -1,44 +0,0 @@ -/* - Copyright © 2010, 2011 Vladimír Vondruš - - This file is part of Magnum. - - Magnum is free software: you can redistribute it and/or modify - it under the terms of the GNU Lesser General Public License version 3 - only, as published by the Free Software Foundation. - - Magnum is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU Lesser General Public License version 3 for more details. -*/ - -#include "Triangle.h" - -#include "Buffer.h" - -namespace Magnum { namespace Examples { - -Triangle::Triangle(Object* parent): Object(parent), mesh(Mesh::Triangles, 3) { - /* Vertices and colors, interleaved */ - Vector4 data[] = { - Vector4(-0.5f, -0.5f, 0.0f), Vector4(1.0f, 0.0f, 0.0f), /* Red lower left vertex */ - Vector4(0.5f, -0.5f, 0.0f), Vector4(0.0f, 1.0f, 0.0f), /* Green lower right vertex */ - Vector4(0.0f, 0.5f, 0.0f), Vector4(0.0f, 0.0f, 1.0f) /* Blue top vertex */ - }; - - /* Fill the mesh with data */ - Buffer* buffer = mesh.addBuffer(true); - buffer->setData(sizeof(data), data, Buffer::DrawStatic); - - /* Bind attributes (first vertex data, then color data) */ - mesh.bindAttribute(buffer, IdentityShader::Vertex); - mesh.bindAttribute(buffer, IdentityShader::Color); -} - -void Triangle::draw(const Matrix4& transformationMatrix, const Matrix4& projectionMatrix) { - shader.use(); - mesh.draw(); -} - -}} diff --git a/examples/triangle/Triangle.h b/examples/triangle/Triangle.h deleted file mode 100644 index 7a8010ce7..000000000 --- a/examples/triangle/Triangle.h +++ /dev/null @@ -1,37 +0,0 @@ -#ifndef Magnum_Examples_Triangle_h -#define Magnum_Examples_Triangle_h -/* - Copyright © 2010, 2011 Vladimír Vondruš - - This file is part of Magnum. - - Magnum is free software: you can redistribute it and/or modify - it under the terms of the GNU Lesser General Public License version 3 - only, as published by the Free Software Foundation. - - Magnum is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU Lesser General Public License version 3 for more details. -*/ - -#include "Object.h" -#include "Mesh.h" -#include "IdentityShader.h" - -namespace Magnum { namespace Examples { - -class Triangle: public Object { - public: - Triangle(Object* parent = 0); - - virtual void draw(const Matrix4& transformationMatrix, const Matrix4& projectionMatrix); - - private: - Mesh mesh; - IdentityShader shader; -}; - -}} - -#endif diff --git a/examples/triangle/main.cpp b/examples/triangle/main.cpp deleted file mode 100644 index 70f12a8ca..000000000 --- a/examples/triangle/main.cpp +++ /dev/null @@ -1,63 +0,0 @@ -/* - Copyright © 2010, 2011 Vladimír Vondruš - - This file is part of Magnum. - - Magnum is free software: you can redistribute it and/or modify - it under the terms of the GNU Lesser General Public License version 3 - only, as published by the Free Software Foundation. - - Magnum is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU Lesser General Public License version 3 for more details. -*/ - -#include -#include -#include - -#include "Scene.h" -#include "Triangle.h" - -Magnum::Scene* s; - -/* Wrapper functions so GLUT can handle that */ -void setViewport(int w, int h) { - s->setViewport(w, h); -} -void draw() { - s->draw(); - glutSwapBuffers(); -} - -int main(int argc, char** argv) { - /* Init GLUT */ - glutInit(&argc, argv); - glutInitDisplayMode(GLUT_DOUBLE|GLUT_RGBA|GLUT_DEPTH|GLUT_STENCIL); - glutInitWindowSize(800, 600); - glutCreateWindow("Shaded Triangle example"); - glutReshapeFunc(setViewport); - glutDisplayFunc(draw); - - /* Init GLEW */ - GLenum err = glewInit(); - if(err != GLEW_OK) { - std::cerr << "GLEW error:" << glewGetErrorString(err) << std::endl; - return 1; - } - - /* Initialize scene */ - Magnum::Scene scene; - s = &scene; - - /* Every scene needs a camera */ - scene.setCamera(new Magnum::Camera(&scene)); - - /* Add triangle to the scene */ - new Magnum::Examples::Triangle(&scene); - - /* Main loop calls draw() periodically and setViewport() on window size change */ - glutMainLoop(); - return 0; -} diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index d3ec22595..70701c292 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -1,3 +1,5 @@ +set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wall -pedantic -std=c++0x") + include_directories(${CMAKE_CURRENT_SOURCE_DIR}) find_package(OpenGL REQUIRED)