istereo2

changeset 12:57188f7d9304

merged changes from macosx
author John Tsiombikas <nuclear@member.fsf.org>
date Mon, 28 Sep 2015 06:53:31 +0300
parents 03cc3b1884d1 2a0ef5efb8e2
children ea928c313344
files src/uitheme.cc
diffstat 5 files changed, 18 insertions(+), 4 deletions(-) [+]
line diff
     1.1 --- a/.hgignore	Mon Sep 28 06:53:06 2015 +0300
     1.2 +++ b/.hgignore	Mon Sep 28 06:53:31 2015 +0300
     1.3 @@ -9,3 +9,4 @@
     1.4  \.png$
     1.5  ^data/
     1.6  \.DS_Store
     1.7 +^test$
     2.1 --- a/Makefile	Mon Sep 28 06:53:06 2015 +0300
     2.2 +++ b/Makefile	Mon Sep 28 06:53:31 2015 +0300
     2.3 @@ -10,10 +10,17 @@
     2.4  
     2.5  CFLAGS = -pedantic -Wall -g $(def) $(incdir)
     2.6  CXXFLAGS = $(CFLAGS)
     2.7 -LDFLAGS = -lGL -lGLU -lglut -lGLEW -lm -ldl
     2.8 +LDFLAGS = $(libgl) -lm -ldl
     2.9  
    2.10  include libs/Makefile
    2.11  
    2.12 +sys := $(shell uname -s)
    2.13 +ifeq ($(sys), Darwin)
    2.14 +	libgl = -framework OpenGL -framework GLUT -lGLEW
    2.15 +else
    2.16 +	libgl = -lGL -lGLU -lglut -lGLEW
    2.17 +endif
    2.18 +
    2.19  $(bin): $(obj)
    2.20  	$(CXX) -o $@ $(obj) $(LDFLAGS)
    2.21  
     3.1 --- a/src/config.h	Mon Sep 28 06:53:06 2015 +0300
     3.2 +++ b/src/config.h	Mon Sep 28 06:53:31 2015 +0300
     3.3 @@ -4,7 +4,7 @@
     3.4  #ifdef __APPLE__
     3.5  #include <TargetConditionals.h>
     3.6  
     3.7 -#if defined(TARGET_IPHONE_SIMULATOR) || defined(TARGET_OS_IPHONE)
     3.8 +#if TARGET_IPHONE_SIMULATOR || TARGET_OS_IPHONE
     3.9  #define IPHONE
    3.10  #define TARGET_IPHONE
    3.11  #endif
     4.1 --- a/src/glut/main.c	Mon Sep 28 06:53:06 2015 +0300
     4.2 +++ b/src/glut/main.c	Mon Sep 28 06:53:31 2015 +0300
     4.3 @@ -20,7 +20,13 @@
     4.4  #include <stdio.h>
     4.5  #include <stdlib.h>
     4.6  #include <GL/glew.h>
     4.7 +
     4.8 +#ifdef __APPLE__
     4.9 +#include <GLUT/glut.h>
    4.10 +#else
    4.11  #include <GL/glut.h>
    4.12 +#endif
    4.13 +
    4.14  #include "sanegl.h"
    4.15  #include "istereo.h"
    4.16  #include "sdr.h"
    4.17 @@ -33,7 +39,7 @@
    4.18  int main(int argc, char **argv)
    4.19  {
    4.20  	glutInit(&argc, argv);
    4.21 -	glutInitWindowSize(640, 920);
    4.22 +	glutInitWindowSize(920, 640);
    4.23  	glutInitDisplayMode(GLUT_RGB | GLUT_DEPTH | GLUT_DOUBLE);
    4.24  	glutCreateWindow("test");
    4.25  
     5.1 --- a/src/uitheme.cc	Mon Sep 28 06:53:06 2015 +0300
     5.2 +++ b/src/uitheme.cc	Mon Sep 28 06:53:31 2015 +0300
     5.3 @@ -28,7 +28,7 @@
     5.4  static std::map<std::string, WidgetDrawFunc> funcmap;
     5.5  
     5.6  
     5.7 -extern "C"// __attribute__ ((used))
     5.8 +extern "C" __attribute__ ((used))
     5.9  WidgetDrawFunc get_widget_func(const char *name)
    5.10  {
    5.11  	static bool initialized;