# HG changeset patch # User John Tsiombikas # Date 1400365150 -10800 # Node ID ae6c5941faac78e018dad9109e3b34fad43dbe97 # Parent f92da4fa9a6d92963593b1654f25921ed7b9c59e [goatview] makefile rules to create app bundle and dmg archive [goatview] creating multisampling context diff -r f92da4fa9a6d -r ae6c5941faac goatview/Makefile --- a/goatview/Makefile Sat May 17 15:42:10 2014 +0300 +++ b/goatview/Makefile Sun May 18 01:19:10 2014 +0300 @@ -14,7 +14,7 @@ CFLAGS = $(warn) -g $(pic) -I$(goat_root)/src $(qtinc) CXXFLAGS = -std=c++11 $(CFLAGS) -LDFLAGS = $(libgoat) $(libgl) $(qtlib) -lvmath +LDFLAGS = $(libgoat) $(libgl) $(qtlib) -lvmath -lanim MOC = moc qtinc = `pkg-config --cflags Qt5Gui Qt5Core Qt5OpenGL` @@ -24,6 +24,8 @@ libgl = -framework OpenGL -framework GLUT -lGLEW libgoat = $(goat_root)/libgoat3d.dylib warn += -Wno-deprecated-declarations + bundle = $(bin).app + dmg = $(bin).dmg else pic = -fPIC libgl = -lGL -lGLU -lglut -lGLEW @@ -35,6 +37,7 @@ endif ifneq ($(shell $(CC) --version | grep LLVM),) CXXFLAGS += -stdlib=libc++ + warn += '-Wno-\#warnings' endif $(bin): $(obj) $(libgoat) @@ -55,6 +58,8 @@ .PHONY: clean clean: rm -f $(obj) $(bin) + [ -n "$(bundle)" ] && rm -rf $(bundle) || true + [ -n "$(dmg)" ] && rm -rf $(dmg) || true .PHONY: cleandep cleandep: @@ -67,3 +72,36 @@ .PHONY: uninstall uninstall: rm -f $(DESTDIR)$(PREFIX)/bin/$(bin) + +.PHONY: echo +echo: + @echo $(var)=\"$($(var))\" + +.PHONY: bundle +bundle: $(bundle) + +.PHONY: dmg +dmg: $(dmg) + +$(bundle): $(bin) $(libgoat) + rm -rf $(bundle) + mkdir -p $(bundle)/Contents/MacOS + mkdir -p $(bundle)/Contents/Frameworks + cp $(bin) $(bundle)/Contents/MacOS/$(bin) + macdeployqt $(bundle) + cp $(libgoat) $(bundle)/Contents/Frameworks + cp /usr/local/lib/libvmath.dylib $(bundle)/Contents/Frameworks + cp /usr/local/lib/libanim.dylib $(bundle)/Contents/Frameworks + +$(dmg): $(bundle) + rm -f $@ + hdiutil create -format UDBZ -quiet -srcfolder $< $@ + +.PHONY: run +ifeq ($(shell uname -s), Darwin) +run: $(bundle) + ./$(bundle)/Contents/MacOS/$(bin) +else +run: $(bin) + ./$(bin) +endif diff -r f92da4fa9a6d -r ae6c5941faac goatview/src/goatview.cc --- a/goatview/src/goatview.cc Sat May 17 15:42:10 2014 +0300 +++ b/goatview/src/goatview.cc Sun May 18 01:19:10 2014 +0300 @@ -21,6 +21,7 @@ static float fov = 60.0; static bool use_nodes = true; static bool use_lighting = true; +static bool use_textures = true; void post_redisplay() { @@ -35,11 +36,16 @@ glview = 0; scene_model = 0; + QGLFormat glfmt = QGLFormat::defaultFormat(); + glfmt.setSampleBuffers(true); + QGLFormat::setDefaultFormat(glfmt); + QSettings settings; resize(settings.value("main/size", QSize(1024, 768)).toSize()); move(settings.value("main/pos", QPoint(100, 100)).toPoint()); use_nodes = settings.value("use_nodes", true).toBool(); use_lighting = settings.value("use_lighting", true).toBool(); + use_textures = settings.value("use_textures", true).toBool(); make_center(); // must be first make_menu(); @@ -237,7 +243,7 @@ // ---- OpenGL viewport ---- GoatViewport::GoatViewport(QWidget *main_win) - : QGLWidget(QGLFormat(QGL::DepthBuffer)) + : QGLWidget(QGLFormat(QGL::DepthBuffer | QGL::SampleBuffers)) { this->main_win = main_win; initialized = false; @@ -281,6 +287,8 @@ float ldir[] = {-1, 1, 2, 0}; glLightfv(GL_LIGHT0, GL_POSITION, ldir); + + glEnable(GL_MULTISAMPLE); } void GoatViewport::resizeGL(int xsz, int ysz)