Permalink
Browse files

Move GLUT header dependency from glui.h to internals

  • Loading branch information...
nigels-com committed Jun 24, 2017
1 parent b95453f commit d25f3481ae37bca2a643176290e24dc5cef4fdea
Showing with 92 additions and 39 deletions.
  1. +6 −0 example/example1.cpp
  2. +6 −0 example/example2.cpp
  3. +6 −0 example/example3.cpp
  4. +6 −0 example/example4.cpp
  5. +6 −0 example/example5.cpp
  6. +6 −0 example/example6.cpp
  7. +13 −0 glui.cpp
  8. +24 −0 glui_internal.h
  9. +19 −39 include/GL/glui.h
View
@@ -14,6 +14,12 @@
#include <string.h>
#include <GL/glui.h>
#ifdef __APPLE__
#include <GLUT/glut.h>
#else
#include <GL/glut.h>
#endif
/** These are the live variables passed into GLUI ***/
int wireframe = 0;
int segments = 8;
View
@@ -13,6 +13,12 @@
#include <string.h>
#include <GL/glui.h>
#ifdef __APPLE__
#include <GLUT/glut.h>
#else
#include <GL/glut.h>
#endif
float xy_aspect;
int last_x, last_y;
float rotationX = 0.0, rotationY = 0.0;
View
@@ -14,6 +14,12 @@
#include <string.h>
#include <GL/glui.h>
#ifdef __APPLE__
#include <GLUT/glut.h>
#else
#include <GL/glut.h>
#endif
float xy_aspect;
int last_x, last_y;
float rotationX = 0.0, rotationY = 0.0;
View
@@ -13,6 +13,12 @@
#include <string.h>
#include <GL/glui.h>
#ifdef __APPLE__
#include <GLUT/glut.h>
#else
#include <GL/glut.h>
#endif
float xy_aspect;
int last_x, last_y;
float rotationX = 0.0, rotationY = 0.0;
View
@@ -14,6 +14,12 @@
#include <string.h>
#include <GL/glui.h>
#ifdef __APPLE__
#include <GLUT/glut.h>
#else
#include <GL/glut.h>
#endif
float xy_aspect;
int last_x, last_y;
float rotationX = 0.0, rotationY = 0.0;
View
@@ -14,6 +14,12 @@
#include <string.h>
#include <GL/glui.h>
#ifdef __APPLE__
#include <GLUT/glut.h>
#else
#include <GL/glut.h>
#endif
/** These are the live variables passed into GLUI ***/
int main_window;
int num_display = 0;
View
@@ -1670,6 +1670,19 @@ void GLUI_Master_Object::set_glutMouseFunc(void (*f)(int button, int state,
add_cb_to_glut_window( glutGetWindow(), GLUI_GLUT_MOUSE, reinterpret_cast<void(*)()>(f));
}
void GLUI_Master_Object::set_glutDisplayFunc(void (*f)(void)) {glutDisplayFunc(f);}
void GLUI_Master_Object::set_glutTimerFunc(unsigned int millis, void (*f)(int value), int value)
{ ::glutTimerFunc(millis,f,value);}
void GLUI_Master_Object::set_glutOverlayDisplayFunc(void(*f)(void)){glutOverlayDisplayFunc(f);}
void GLUI_Master_Object::set_glutSpaceballMotionFunc(Int3_CB f) {glutSpaceballMotionFunc(f);}
void GLUI_Master_Object::set_glutSpaceballRotateFunc(Int3_CB f) {glutSpaceballRotateFunc(f);}
void GLUI_Master_Object::set_glutSpaceballButtonFunc(Int2_CB f) {glutSpaceballButtonFunc(f);}
void GLUI_Master_Object::set_glutTabletMotionFunc(Int2_CB f) {glutTabletMotionFunc(f);}
void GLUI_Master_Object::set_glutTabletButtonFunc(Int4_CB f) {glutTabletButtonFunc(f);}
void GLUI_Master_Object::set_glutMenuStatusFunc(Int3_CB f) {glutMenuStatusFunc(f);}
void GLUI_Master_Object::set_glutMenuStateFunc(Int1_CB f) {glutMenuStateFunc(f);}
void GLUI_Master_Object::set_glutButtonBoxFunc(Int2_CB f) {glutButtonBoxFunc(f);}
void GLUI_Master_Object::set_glutDialsFunc(Int2_CB f) {glutDialsFunc(f);}
/****************************** glui_parent_window_reshape_func() **********/
/* This is the reshape callback for a window that contains subwindows */
View
@@ -22,6 +22,30 @@
#include <cmath>
#include <cassert>
#if defined(GLUI_FREEGLUT)
// FreeGLUT does not yet work perfectly with GLUI
// - use at your own risk.
#include <GL/freeglut.h>
#elif defined(GLUI_OPENGLUT)
// OpenGLUT does not yet work properly with GLUI
// - use at your own risk.
#include <GL/openglut.h>
#else
#ifdef __APPLE__
#include <GLUT/glut.h>
#else
#include <GL/glut.h>
#endif
#endif
#ifndef AND
#define AND &&
#define OR ||
View
@@ -34,34 +34,15 @@
#ifndef GLUI_GLUI_H
#define GLUI_GLUI_H
// Having stdlib here first fixes some 'exit() redefined' errors on MSVC.NET
// that come from old GLUT headers.
#include <cstdlib>
#if defined(GLUI_FREEGLUT)
// FreeGLUT does not yet work perfectly with GLUI
// - use at your own risk.
#include <GL/freeglut.h>
#elif defined(GLUI_OPENGLUT)
// OpenGLUT does not yet work properly with GLUI
// - use at your own risk.
#include <GL/openglut.h>
#else
#ifdef __APPLE__
#include <GLUT/glut.h>
#else
#include <GL/glut.h>
#endif
#ifdef __APPLE__
#include <OpenGL/GL.h>
#include <OpenGL/GLU.h>
#else
#include <GL/gl.h>
#include <GL/glu.h>
#endif
#include <cstdlib>
#include <cstdio>
#include <cstring>
@@ -510,20 +491,19 @@ class GLUIAPI GLUI_Master_Object
void set_glutSpecialFunc (void (*f)(int key, int x, int y));
void set_glutMouseFunc (void (*f)(int, int, int, int ));
void set_glutDisplayFunc(void (*f)()) {glutDisplayFunc(f);}
void set_glutTimerFunc(unsigned int millis, void (*f)(int value), int value)
{ ::glutTimerFunc(millis,f,value);}
void set_glutOverlayDisplayFunc(void(*f)()){glutOverlayDisplayFunc(f);}
void set_glutSpaceballMotionFunc(Int3_CB f) {glutSpaceballMotionFunc(f);}
void set_glutSpaceballRotateFunc(Int3_CB f) {glutSpaceballRotateFunc(f);}
void set_glutSpaceballButtonFunc(Int2_CB f) {glutSpaceballButtonFunc(f);}
void set_glutTabletMotionFunc(Int2_CB f) {glutTabletMotionFunc(f);}
void set_glutTabletButtonFunc(Int4_CB f) {glutTabletButtonFunc(f);}
void set_glutDisplayFunc(void (*f)(void));
void set_glutTimerFunc(unsigned int millis, void (*f)(int value), int value);
void set_glutOverlayDisplayFunc(void(*f)(void));
void set_glutSpaceballMotionFunc(Int3_CB f);
void set_glutSpaceballRotateFunc(Int3_CB f);
void set_glutSpaceballButtonFunc(Int2_CB f);
void set_glutTabletMotionFunc(Int2_CB f);
void set_glutTabletButtonFunc(Int4_CB f);
/* void set_glutWindowStatusFunc(Int1_CB f) {glutWindowStatusFunc(f);} */
void set_glutMenuStatusFunc(Int3_CB f) {glutMenuStatusFunc(f);}
void set_glutMenuStateFunc(Int1_CB f) {glutMenuStateFunc(f);}
void set_glutButtonBoxFunc(Int2_CB f) {glutButtonBoxFunc(f);}
void set_glutDialsFunc(Int2_CB f) {glutDialsFunc(f);}
void set_glutMenuStatusFunc(Int3_CB f);
void set_glutMenuStateFunc(Int1_CB f);
void set_glutButtonBoxFunc(Int2_CB f);
void set_glutDialsFunc(Int2_CB f);
GLUI *create_glui( const GLUI_String &name, long flags=0, int x=-1, int y=-1 );

0 comments on commit d25f348

Please sign in to comment.