From: Alex Schmidt Date: Tue, 19 Feb 2013 09:24:22 +0000 (+0100) Subject: ... X-Git-Url: http://git.treefish.org/~alex/phys/latlib.git/commitdiff_plain/37439b2f85687ddafa4097d07237fc17a0a6db0d?ds=sidebyside;hp=56501911055f24d1b06f2847c55e6d359dbd1760 ... --- diff --git a/CMakeLists.txt b/CMakeLists.txt index 5cbe4e5..96f472a 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -14,7 +14,7 @@ add_library(lat_progress progress.cpp) find_package(OpenGL REQUIRED) find_package(GLUT REQUIRED) include_directories( ${OPENGL_INCLUDE_DIRS} ${GLUT_INCLUDE_DIRS} ../ ) -add_library(lat_culooks culooks.cpp) +add_library(lat_culooks culooks.cpp culooks_cube.cpp) target_link_libraries(lat_culooks ${OPENGL_LIBRARIES} ${GLUT_LIBRARY}) add_executable(neigh_test neigh_test.cpp) diff --git a/culooks.cpp b/culooks.cpp index 8c41d23..cb5eda7 100644 --- a/culooks.cpp +++ b/culooks.cpp @@ -1,5 +1,12 @@ #include "culooks.h" +#include +#include +#include +#include +#include +#include + #include #include @@ -8,94 +15,8 @@ pthread_t culooks::glThreadId; int culooks::windowid = 0; -int culooks::cube::allid = 0; - using namespace std; -void culooks::cube::draw() -{ - glMatrixMode(GL_MODELVIEW); - glPushMatrix(); - - //cout << zoom << endl; - - glScalef(zoom, zoom, zoom); - glRotatef(az, 0, 1, 0); - glRotatef(alt, 1, 0, 0); - - /* - glBegin(GL_QUADS); - glVertex2f(-1, -1); glVertex2f(1, -1); glVertex2f(1, 1); glVertex2f(-1, 1); - glEnd(); - */ - - //drawBox(); - drawAll(); - - glPopMatrix(); -} - -void culooks::cube::drawAll() -{ - glMatrixMode(GL_MODELVIEW); - glPushMatrix(); - - glTranslatef(-1,-1,-1); - - for (int iz=0; iz #include +#include "culooks_cube.h" + using namespace std; class culooks { public: - class cube { - public: - cube(int l); - void draw(); - int id; - float az, alt; - float zoom; - private: - void drawAll(); - void drawBox(); - static int allid; - float *plaq; - float *link; - int l; - }; - struct window { int layout[2]; double aspect;