Skip to content
Browse files

initial Regal commit

  • Loading branch information...
1 parent af109c3 commit e126329aab360d5140e2e22ad181c68fbdf17fcd @casseveritt casseveritt committed
Showing with 96,335 additions and 0 deletions.
  1. +311 −0 Makefile
  2. +23 −0 config/Makefile.cygwin
  3. +30 −0 config/Makefile.darwin
  4. +30 −0 config/Makefile.darwin-ppc
  5. +30 −0 config/Makefile.darwin-x86_64
  6. +30 −0 config/Makefile.linux
  7. +32 −0 config/Makefile.linux-32
  8. +32 −0 config/Makefile.linux-64
  9. +1,523 −0 config/config.guess
  10. +7 −0 config/version
  11. +8 −0 examples/dreamtorus/android/.classpath
  12. +33 −0 examples/dreamtorus/android/.project
  13. +38 −0 examples/dreamtorus/android/AndroidManifest.xml
  14. +2 −0 examples/dreamtorus/android/default.properties
  15. +45 −0 examples/dreamtorus/android/jni/Android.mk
  16. +3 −0 examples/dreamtorus/android/jni/Application.mk
  17. +19 −0 examples/dreamtorus/android/jni/Regal.mk
  18. +197 −0 examples/dreamtorus/android/jni/gl_code.cpp
  19. +11 −0 examples/dreamtorus/android/project.properties
  20. +29 −0 examples/dreamtorus/android/res/values/strings.xml
  21. +46 −0 examples/dreamtorus/android/src/com/nvidia/minimalAndroid/MinimalAndroidActivity.java
  22. +33 −0 examples/dreamtorus/android/src/com/nvidia/minimalAndroid/MinimalAndroidLib.java
  23. +339 −0 examples/dreamtorus/android/src/com/nvidia/minimalAndroid/MinimalAndroidView.java
  24. +63 −0 examples/dreamtorus/glut/code/main.cpp
  25. +36 −0 examples/dreamtorus/glx/Makefile
  26. +105 −0 examples/dreamtorus/glx/main.cpp
  27. +16 −0 examples/dreamtorus/ios/RGLOpenGLContext.h
  28. +15 −0 examples/dreamtorus/ios/RGLOpenGLContext.m
  29. +34 −0 examples/dreamtorus/ios/minimal_ios/EAGLView.h
  30. +148 −0 examples/dreamtorus/ios/minimal_ios/EAGLView.mm
  31. +7 −0 examples/dreamtorus/ios/minimal_ios/Shaders/Shader.fsh
  32. +16 −0 examples/dreamtorus/ios/minimal_ios/Shaders/Shader.vsh
  33. +2 −0 examples/dreamtorus/ios/minimal_ios/en.lproj/InfoPlist.strings
  34. +196 −0 examples/dreamtorus/ios/minimal_ios/en.lproj/MainWindow.xib
  35. +145 −0 examples/dreamtorus/ios/minimal_ios/en.lproj/minimal_iosViewController.xib
  36. +203 −0 examples/dreamtorus/ios/minimal_ios/iPad/en.lproj/MainWindow-iPad.xib
  37. +17 −0 examples/dreamtorus/ios/minimal_ios/main.m
  38. +42 −0 examples/dreamtorus/ios/minimal_ios/minimal_ios-Info.plist
  39. +14 −0 examples/dreamtorus/ios/minimal_ios/minimal_ios-Prefix.pch
  40. +19 −0 examples/dreamtorus/ios/minimal_ios/minimal_iosAppDelegate.h
  41. +76 −0 examples/dreamtorus/ios/minimal_ios/minimal_iosAppDelegate.m
  42. +33 −0 examples/dreamtorus/ios/minimal_ios/minimal_iosViewController.h
  43. +395 −0 examples/dreamtorus/ios/minimal_ios/minimal_iosViewController.mm
  44. +2 −0 examples/dreamtorus/osx/English.lproj/InfoPlist.strings
  45. +3,652 −0 examples/dreamtorus/osx/English.lproj/MainMenu.xib
  46. +16 −0 examples/dreamtorus/osx/RGLOpenGLContext.h
  47. +13 −0 examples/dreamtorus/osx/RGLOpenGLContext.m
  48. +16 −0 examples/dreamtorus/osx/RegalView.h
  49. +83 −0 examples/dreamtorus/osx/RegalView.mm
  50. +14 −0 examples/dreamtorus/osx/main.mm
  51. +34 −0 examples/dreamtorus/osx/minimal_osx-Info.plist
  52. +17 −0 examples/dreamtorus/osx/minimal_osxAppDelegate.h
  53. +19 −0 examples/dreamtorus/osx/minimal_osxAppDelegate.mm
  54. +7 −0 examples/dreamtorus/osx/minimal_osx_Prefix.pch
  55. BIN examples/dreamtorus/osx/nv.icns
  56. +246 −0 examples/dreamtorus/src/render.cpp
  57. +13 −0 examples/dreamtorus/src/render.h
  58. +154 −0 examples/dreamtorus/win32/minimal.cpp
  59. +20 −0 examples/dreamtorus/win32/minimal.sln
  60. +211 −0 examples/dreamtorus/win32/minimal.vcproj
  61. +11 −0 examples/tiger/ReadMe.txt
  62. +305 −0 examples/tiger/nvpr_tiger.c
  63. +135 −0 examples/tiger/tiger.c
  64. +18 −0 examples/tiger/tiger.h
  65. +241 −0 examples/tiger/tiger_paths.h
  66. +242 −0 examples/tiger/tiger_style.h
  67. +137 −0 examples/tiger/xform.c
  68. +28 −0 examples/tiger/xform.h
  69. +20,211 −0 include/GL/Regal.h
  70. +16,270 −0 include/GL/RegalGLEW.h
  71. +665 −0 include/GL/RegalGLUT.h
  72. +1,599 −0 include/GL/RegalGLXEW.h
  73. +1,385 −0 include/GL/RegalWGLEW.h
  74. +16,270 −0 src/glew/include/GL/glew.h
  75. +1,599 −0 src/glew/include/GL/glxew.h
  76. +1,385 −0 src/glew/include/GL/wglew.h
  77. +16,143 −0 src/glew/src/glew.c
  78. +9,475 −0 src/glew/src/glewinfo.c
  79. +1,178 −0 src/glew/src/visualinfo.c
  80. +88 −0 src/glu/glu.def
Sorry, we could not display the entire diff because too many files (371) changed.
View
311 Makefile
@@ -0,0 +1,311 @@
+include config/version
+
+SHELL = /bin/sh
+SYSTEM ?= $(shell config/config.guess | cut -d - -f 3 | sed -e 's/[0-9\.]//g;')
+SYSTEM.SUPPORTED = $(shell test -f config/Makefile.$(SYSTEM) && echo 1)
+
+ifeq ($(SYSTEM.SUPPORTED), 1)
+include config/Makefile.$(SYSTEM)
+else
+$(error "Platform '$(SYSTEM)' not supported")
+endif
+
+REGAL_DEST ?= /usr
+BINDIR ?= $(REGAL_DEST)/bin
+LIBDIR ?= $(REGAL_DEST)/lib
+
+# To disable stripping of binaries either:
+# - use STRIP= on gmake command-line
+# - edit this makefile to set STRIP to the empty string
+#
+# To disable symlinks:
+# - use LN= on gmake command-line
+
+AR ?= ar
+INSTALL ?= install
+STRIP ?= strip
+RM ?= rm -f
+LN ?= ln -sf
+
+ifeq ($(MAKECMDGOALS), debug)
+OPT = -g
+STRIP :=
+else
+OPT = $(POPT)
+endif
+INCLUDE = -Iinclude
+CFLAGS = $(OPT) $(WARN) $(INCLUDE) $(CFLAGS.EXTRA)
+
+all debug: regal.lib glew.lib glut.lib regal.bin
+
+# REGAL shared and static libraries
+
+export:
+ scripts/Export.py --api gl 4.2 --api wgl 4.0 --api glx 4.0 --api cgl 1.4 --api egl 1.0 --outdir src/regal
+
+LIB.LDFLAGS := $(LDFLAGS.EXTRA) $(LDFLAGS.GL) -lstdc++ -lpthread
+LIB.LIBS := $(GL_LDFLAGS)
+
+LIB.SRCS :=
+LIB.SRCS += src/regal/RegalIff.cpp
+LIB.SRCS += src/regal/Regal.cpp
+LIB.SRCS += src/regal/RegalLookup.cpp
+LIB.SRCS += src/regal/RegalEmuDispatch.cpp
+LIB.SRCS += src/regal/RegalErrorDispatch.cpp
+LIB.SRCS += src/regal/RegalLoaderDispatch.cpp
+
+LIB.SRCS.NAMES := $(notdir $(LIB.SRCS))
+
+LIB.DEPS :=
+LIB.DEPS += include/GL/Regal.h
+LIB.DEPS += src/regal/RegalPrivate.h
+
+LIB.OBJS := $(addprefix tmp/$(SYSTEM)/regal/static/,$(LIB.SRCS.NAMES))
+LIB.OBJS := $(LIB.OBJS:.cpp=.o)
+LIB.SOBJS := $(addprefix tmp/$(SYSTEM)/regal/shared/,$(LIB.SRCS.NAMES))
+LIB.SOBJS := $(LIB.SOBJS:.cpp=.o)
+
+regal.lib: lib lib/$(LIB.SHARED) lib/$(LIB.STATIC)
+
+lib:
+ mkdir lib
+
+lib/$(LIB.STATIC): $(LIB.OBJS)
+ $(AR) cr $@ $^
+ifneq ($(STRIP),)
+ $(STRIP) -x $@
+endif
+
+lib/$(LIB.SHARED): $(LIB.SOBJS)
+ $(LD) $(LDFLAGS.SO) -o $@ $^ $(LIB.LDFLAGS) $(LIB.LIBS)
+ifneq ($(LN),)
+ $(LN) $(LIB.SHARED) lib/$(LIB.SONAME)
+ $(LN) $(LIB.SHARED) lib/$(LIB.DEVLNK)
+ifneq ($(LIB.FRAMEWORK),)
+ $(LN) $(LIB.SHARED) lib/$(LIB.FRAMEWORK)
+endif
+endif
+ifneq ($(STRIP),)
+ $(STRIP) -x $@
+endif
+
+tmp/$(SYSTEM)/regal/static/%.o: src/regal/%.cpp $(LIB.DEPS)
+ @mkdir -p $(dir $@)
+ $(CC) $(CFLAGS) $(CFLAGS.SO) -o $@ -c $<
+
+tmp/$(SYSTEM)/regal/shared/%.o: src/regal/%.cpp $(LIB.DEPS)
+ @mkdir -p $(dir $@)
+ $(CC) $(CFLAGS) $(PICFLAG) $(CFLAGS.SO) -o $@ -c $<
+
+#
+# RegalGLEW
+#
+
+GLEW.SRCS += src/glew/src/glew.c
+GLEW.SRCS.NAMES := $(notdir $(GLEW.SRCS))
+GLEW.OBJS := $(addprefix tmp/$(SYSTEM)/glew/shared/,$(GLEW.SRCS.NAMES))
+GLEW.OBJS := $(GLEW.OBJS:.c=.o)
+GLEW.CFLAGS := -Isrc/glew/include -DGLEW_EXPORTS -DGLEW_BUILD
+GLEW.SHARED := libRegalGLEW.$(EXT.DYNAMIC)
+GLEW.STATIC := libRegalGLEW.a
+
+glew.lib: lib lib/$(GLEW.SHARED)
+
+tmp/$(SYSTEM)/glew/shared/%.o: src/glew/src/%.c
+ @mkdir -p $(dir $@)
+ $(CC) $(CFLAGS) $(PICFLAG) $(GLEW.CFLAGS) $(CFLAGS.SO) -o $@ -c $<
+
+lib/$(GLEW.SHARED): $(GLEW.OBJS)
+ $(LD) $(LDFLAGS.DYNAMIC) -o $@ $^ $(LIB.LDFLAGS) $(GLEW.LIBS) -lpthread
+ifneq ($(STRIP),)
+ $(STRIP) -x $@
+endif
+
+ifneq ($(filter darwin%,$(SYSTEM)),)
+glut.lib:
+
+else
+
+#
+# RegalGLUT
+#
+
+# NOT for windows...
+
+GLUT.SRCS += src/glut/src/capturexfont.c
+GLUT.SRCS += src/glut/src/glut_glxext.c
+GLUT.SRCS += src/glut/src/glut_menu.c
+GLUT.SRCS += src/glut/src/glut_menu2.c
+GLUT.SRCS += src/glut/src/layerutil.c
+
+# Windows and Linux...
+
+GLUT.SRCS += src/glut/src/glut_8x13.c
+GLUT.SRCS += src/glut/src/glut_9x15.c
+GLUT.SRCS += src/glut/src/glut_bitmap.c
+GLUT.SRCS += src/glut/src/glut_bwidth.c
+GLUT.SRCS += src/glut/src/glut_cindex.c
+GLUT.SRCS += src/glut/src/glut_cmap.c
+GLUT.SRCS += src/glut/src/glut_cursor.c
+GLUT.SRCS += src/glut/src/glut_dials.c
+GLUT.SRCS += src/glut/src/glut_dstr.c
+GLUT.SRCS += src/glut/src/glut_event.c
+GLUT.SRCS += src/glut/src/glut_ext.c
+GLUT.SRCS += src/glut/src/glut_fcb.c
+GLUT.SRCS += src/glut/src/glut_fullscrn.c
+GLUT.SRCS += src/glut/src/glut_gamemode.c
+GLUT.SRCS += src/glut/src/glut_get.c
+GLUT.SRCS += src/glut/src/glut_hel10.c
+GLUT.SRCS += src/glut/src/glut_hel12.c
+GLUT.SRCS += src/glut/src/glut_hel18.c
+GLUT.SRCS += src/glut/src/glut_init.c
+GLUT.SRCS += src/glut/src/glut_input.c
+GLUT.SRCS += src/glut/src/glut_joy.c
+GLUT.SRCS += src/glut/src/glut_key.c
+GLUT.SRCS += src/glut/src/glut_keyctrl.c
+GLUT.SRCS += src/glut/src/glut_keyup.c
+GLUT.SRCS += src/glut/src/glut_mesa.c
+GLUT.SRCS += src/glut/src/glut_modifier.c
+GLUT.SRCS += src/glut/src/glut_mroman.c
+GLUT.SRCS += src/glut/src/glut_overlay.c
+GLUT.SRCS += src/glut/src/glut_roman.c
+GLUT.SRCS += src/glut/src/glut_shapes.c
+GLUT.SRCS += src/glut/src/glut_space.c
+GLUT.SRCS += src/glut/src/glut_stroke.c
+GLUT.SRCS += src/glut/src/glut_swap.c
+GLUT.SRCS += src/glut/src/glut_swidth.c
+GLUT.SRCS += src/glut/src/glut_tablet.c
+GLUT.SRCS += src/glut/src/glut_teapot.c
+GLUT.SRCS += src/glut/src/glut_tr10.c
+GLUT.SRCS += src/glut/src/glut_tr24.c
+GLUT.SRCS += src/glut/src/glut_util.c
+GLUT.SRCS += src/glut/src/glut_vidresize.c
+GLUT.SRCS += src/glut/src/glut_warp.c
+GLUT.SRCS += src/glut/src/glut_win.c
+GLUT.SRCS += src/glut/src/glut_winmisc.c
+GLUT.SRCS += src/glut/src/glut_ppm.c
+GLUT.SRCS.NAMES := $(notdir $(GLUT.SRCS))
+GLUT.OBJS := $(addprefix tmp/$(SYSTEM)/glut/shared/,$(GLUT.SRCS.NAMES))
+GLUT.OBJS := $(GLUT.OBJS:.c=.o)
+GLUT.CFLAGS := -Isrc/glut/include -DBUILD_GLUT32 -DGLUT_BUILDING_LIB -DGLUT_STATIC
+GLUT.SHARED := libRegalGLUT.$(EXT.DYNAMIC)
+GLUT.STATIC := libRegalGLUT.a
+
+glut.lib: lib lib/$(GLUT.SHARED)
+
+tmp/$(SYSTEM)/glut/shared/%.o: src/glut/src/%.c
+ @mkdir -p $(dir $@)
+ $(CC) $(CFLAGS) $(PICFLAG) $(GLUT.CFLAGS) $(CFLAGS.SO) -o $@ -c $<
+
+lib/$(GLUT.SHARED): $(GLUT.OBJS)
+ $(LD) $(LDFLAGS.DYNAMIC) -o $@ $^ -Llib -lRegal -lGLU -lX11 -lXmu -lXi -lpthread
+ifneq ($(STRIP),)
+ $(STRIP) -x $@
+endif
+
+endif
+
+# Examples
+
+regal.bin: bin bin/dreamtorus bin/tiger bin/byte_code_shaders
+
+bin:
+ mkdir bin
+
+#
+# dreamtorus
+#
+
+DREAMTORUS.SRCS += examples/dreamtorus/src/render.cpp
+DREAMTORUS.SRCS += examples/dreamtorus/glut/code/main.cpp
+DREAMTORUS.SRCS.NAMES := $(notdir $(DREAMTORUS.SRCS))
+DREAMTORUS.OBJS := $(addprefix tmp/$(SYSTEM)/dreamtorus/static/,$(DREAMTORUS.SRCS.NAMES))
+DREAMTORUS.OBJS := $(DREAMTORUS.OBJS:.cpp=.o)
+DREAMTORUS.CFLAGS := -Iinclude -Iexamples/dreamtorus/src
+
+tmp/$(SYSTEM)/dreamtorus/static/%.o: examples/dreamtorus/src/%.cpp
+ @mkdir -p $(dir $@)
+ $(CC) $(CFLAGS) $(DREAMTORUS.CFLAGS) $(CFLAGS.SO) -o $@ -c $<
+
+tmp/$(SYSTEM)/dreamtorus/static/%.o: examples/dreamtorus/glut/code/%.cpp
+ @mkdir -p $(dir $@)
+ $(CC) $(CFLAGS) $(DREAMTORUS.CFLAGS) $(CFLAGS.SO) -o $@ -c $<
+
+bin/dreamtorus: $(DREAMTORUS.OBJS)
+ $(LD) -o $@ $^ $(LIB.LDFLAGS) $(LIB.LIBS) $(LDFLAGS.GLUT) $(LDFLAGS.GL) -Llib -l$(NAME) -lm -lpthread
+ifneq ($(STRIP),)
+ $(STRIP) -x $@
+endif
+
+#
+# tiger
+#
+
+TIGER.SRCS += examples/tiger/nvpr_tiger.c
+TIGER.SRCS += examples/tiger/tiger.c
+TIGER.SRCS += examples/tiger/xform.c
+TIGER.SRCS.NAMES := $(notdir $(TIGER.SRCS))
+TIGER.OBJS := $(addprefix tmp/$(SYSTEM)/tiger/static/,$(TIGER.SRCS.NAMES))
+TIGER.OBJS := $(TIGER.OBJS:.c=.o)
+TIGER.CFLAGS := -Iinclude
+
+tmp/$(SYSTEM)/tiger/static/%.o: examples/tiger/%.c
+ @mkdir -p $(dir $@)
+ $(CC) $(CFLAGS) $(TIGER.CFLAGS) $(CFLAGS.SO) -o $@ -c $<
+
+bin/tiger: $(TIGER.OBJS)
+ $(LD) -o $@ $^ -Llib -l$(NAME) -lRegalGLEW $(LDFLAGS.GLUT) -lm -lpthread
+ifneq ($(STRIP),)
+ $(STRIP) -x $@
+endif
+
+#
+# byte_code_shaders
+#
+
+BYTE_CODE_SHADERS.SRCS += examples/byte_code_shaders/main.cpp
+BYTE_CODE_SHADERS.SRCS += examples/byte_code_shaders/xform.cpp
+
+BYTE_CODE_SHADERS.SRCS += src/mojoshader/mojoshader_assembler.c
+BYTE_CODE_SHADERS.SRCS += src/mojoshader/mojoshader.c
+BYTE_CODE_SHADERS.SRCS += src/mojoshader/mojoshader_common.c
+BYTE_CODE_SHADERS.SRCS += src/mojoshader/mojoshader_compiler.c
+BYTE_CODE_SHADERS.SRCS += src/mojoshader/mojoshader_effects.c
+BYTE_CODE_SHADERS.SRCS += src/mojoshader/mojoshader_lexer.c
+#BYTE_CODE_SHADERS.SRCS += src/mojoshader/mojoshader_opengl.c
+BYTE_CODE_SHADERS.SRCS += src/mojoshader/mojoshader_preprocessor.c
+
+BYTE_CODE_SHADERS.SRCS.NAMES := $(notdir $(BYTE_CODE_SHADERS.SRCS))
+BYTE_CODE_SHADERS.OBJS := $(addprefix tmp/$(SYSTEM)/byte_code_shaders/static/,$(BYTE_CODE_SHADERS.SRCS.NAMES))
+BYTE_CODE_SHADERS.OBJS := $(BYTE_CODE_SHADERS.OBJS:.c=.o)
+BYTE_CODE_SHADERS.OBJS := $(BYTE_CODE_SHADERS.OBJS:.cpp=.o)
+BYTE_CODE_SHADERS.CFLAGS := -Iinclude
+BYTE_CODE_SHADERS.CFLAGS += -Isrc/mojoshader/
+BYTE_CODE_SHADERS.CFLAGS += -DMOJOSHADER_NO_VERSION_INCLUDE
+#BYTE_CODE_SHADERS.CFLAGS += -DREGAL_NO_TYPEDEF_GL_VERSION_1_0
+#BYTE_CODE_SHADERS.CFLAGS += -DREGAL_NO_DECLARATION_GL_VERSION_1_0
+
+tmp/$(SYSTEM)/byte_code_shaders/static/%.o: examples/byte_code_shaders/%.cpp
+ @mkdir -p $(dir $@)
+ $(CC) $(CFLAGS) $(BYTE_CODE_SHADERS.CFLAGS) $(CFLAGS.SO) -o $@ -c $<
+
+tmp/$(SYSTEM)/byte_code_shaders/static/%.o: src/mojoshader/%.c
+ @mkdir -p $(dir $@)
+ $(CC) $(CFLAGS) $(BYTE_CODE_SHADERS.CFLAGS) $(CFLAGS.SO) -o $@ -c $<
+
+bin/byte_code_shaders: $(BYTE_CODE_SHADERS.OBJS)
+ $(LD) -o $@ $^ -Llib -l$(NAME) -lRegalGLEW $(LDFLAGS.GLUT) -lstdc++ -lm -lpthread
+ifneq ($(STRIP),)
+ $(STRIP) -x $@
+endif
+
+clean:
+ $(RM) -r tmp/
+ $(RM) -r lib/
+ $(RM) -r bin/
+ $(RM) glew.pc glewmx.pc
+
+
+.PHONY: export
+.PHONY: regal.lib regal.bin all debug
+.PHONY: clean distclean tardist dist-win32 dist-src
View
23 config/Makefile.cygwin
@@ -0,0 +1,23 @@
+NAME = $(REGAL_NAME)
+CC = cc
+LD = cc
+PICFLAG =
+LDFLAGS.EXTRA =
+LIBDIR =
+LDFLAGS.GL = -lXmu -lXi -lGLU -lGL -lXext -lX11
+LDFLAGS.GLUT = -lglut
+LDFLAGS.STATIC = -Wl,-Bstatic
+LDFLAGS.DYNAMIC = -Wl,-Bdynamic
+WARN = -Wall -W
+POPT = -O2
+BIN.SUFFIX =
+LIB.SONAME = lib$(NAME).so.$(SO_MAJOR)
+LIB.DEVLNK = lib$(NAME).so
+LIB.SHARED = lib$(NAME).so.$(SO_VERSION)
+LIB.STATIC = lib$(NAME).a
+LDFLAGS.SO = -shared -Wl,-soname=$(LIB.SONAME)
+LIB.SONAME.MX = lib$(NAME)mx.so.$(SO_MAJOR)
+LIB.DEVLNK.MX = lib$(NAME)mx.so
+LIB.SHARED.MX = lib$(NAME)mx.so.$(SO_VERSION)
+LIB.STATIC.MX = lib$(NAME)mx.a
+LDFLAGS.SO.MX = -shared -Wl,-soname=$(LIB.SONAME.MX)
View
30 config/Makefile.darwin
@@ -0,0 +1,30 @@
+NAME = $(REGAL_NAME)
+CC = cc
+LD = cc
+EXT.DYNAMIC = dylib
+CFLAGS.EXTRA = -no-cpp-precomp -dynamic -fno-common
+PICFLAG = -fPIC
+LDFLAGS.EXTRA =
+ifneq (undefined, $(origin REGAL_APPLE_GLX))
+CFLAGS.EXTRA += -I/usr/X11R6/include -D'REGAL_APPLE_GLX'
+LDFLAGS.GL = -L/usr/X11R6/lib -lXmu -lXi -lGLU -lGL -lXext -lX11
+else
+LDFLAGS.GL = -framework AGL -framework OpenGL
+LDFLAGS.GLUT = -framework GLUT
+endif
+LDFLAGS.STATIC =
+LDFLAGS.DYNAMIC = -dynamiclib
+WARN = -Wall -W -Wno-unused-parameter
+POPT = -O2
+BIN.SUFFIX =
+LIB.SONAME = lib$(NAME).$(SO_MAJOR).dylib
+LIB.DEVLNK = lib$(NAME).dylib
+LIB.SHARED = lib$(NAME).$(SO_VERSION).dylib
+LIB.STATIC = lib$(NAME).a
+LIB.FRAMEWORK = $(NAME)
+LDFLAGS.SO = $(LDFLAGS.DYNAMIC) -install_name $(REGAL_DEST)/lib/$(LIB.SHARED) -current_version $(SO_VERSION) -compatibility_version $(SO_MAJOR)
+LIB.SONAME.MX = lib$(NAME)mx.$(SO_MAJOR).dylib
+LIB.DEVLNK.MX = lib$(NAME)mx.dylib
+LIB.SHARED.MX = lib$(NAME)mx.$(SO_VERSION).dylib
+LIB.STATIC.MX = lib$(NAME)mx.a
+LDFLAGS.SO.MX = -dynamiclib -install_name $(REGAL_DEST)/lib/$(LIB.SHARED.MX) -current_version $(SO_VERSION) -compatibility_version $(SO_MAJOR)
View
30 config/Makefile.darwin-ppc
@@ -0,0 +1,30 @@
+NAME = $(REGAL_NAME)
+CC = cc
+LD = cc
+EXT.DYNAMIC = dylib
+CFLAGS.EXTRA = -arch ppc -no-cpp-precomp -dynamic -fno-common
+PICFLAG = -fPIC
+LDFLAGS.EXTRA = -arch ppc
+ifneq (undefined, $(origin REGAL_APPLE_GLX))
+CFLAGS.EXTRA += -I/usr/X11R6/include -D'REGAL_APPLE_GLX'
+LDFLAGS.GL = -L/usr/X11R6/lib -lXmu -lXi -lGLU -lGL -lXext -lX11
+else
+LDFLAGS.GL = -framework AGL -framework OpenGL
+LDFLAGS.GLUT = -framework GLUT
+endif
+LDFLAGS.STATIC =
+LDFLAGS.DYNAMIC = -dynamiclib
+WARN = -Wall -W -Wno-unused-parameter
+POPT = -O2
+BIN.SUFFIX =
+LIB.SONAME = lib$(NAME).$(SO_MAJOR).dylib
+LIB.DEVLNK = lib$(NAME).dylib
+LIB.SHARED = lib$(NAME).$(SO_VERSION).dylib
+LIB.STATIC = lib$(NAME).a
+LIB.FRAMEWORK = $(NAME)
+LDFLAGS.SO = $(LDFLAGS.DYNAMIC) -install_name $(REGAL_DEST)/lib/$(LIB.SHARED) -current_version $(SO_VERSION) -compatibility_version $(SO_MAJOR)
+LIB.SONAME.MX = lib$(NAME)mx.$(SO_MAJOR).dylib
+LIB.DEVLNK.MX = lib$(NAME)mx.dylib
+LIB.SHARED.MX = lib$(NAME)mx.$(SO_VERSION).dylib
+LIB.STATIC.MX = lib$(NAME)mx.a
+LDFLAGS.SO.MX = -dynamiclib -install_name $(REGAL_DEST)/lib/$(LIB.SHARED.MX) -current_version $(SO_VERSION) -compatibility_version $(SO_MAJOR)
View
30 config/Makefile.darwin-x86_64
@@ -0,0 +1,30 @@
+NAME = $(REGAL_NAME)
+CC = cc
+LD = cc
+EXT.DYNAMIC = dylib
+CFLAGS.EXTRA = -arch x86_64 -no-cpp-precomp -dynamic -fno-common
+PICFLAG = -fPIC
+LDFLAGS.EXTRA = -arch x86_64
+ifneq (undefined, $(origin REGAL_APPLE_GLX))
+CFLAGS.EXTRA += -I/usr/X11R6/include -D'REGAL_APPLE_GLX'
+LDFLAGS.GL = -L/usr/X11R6/lib -lXmu -lXi -lGLU -lGL -lXext -lX11
+else
+LDFLAGS.GL = -framework AGL -framework OpenGL
+LDFLAGS.GLUT = -framework GLUT
+endif
+LDFLAGS.STATIC =
+LDFLAGS.DYNAMIC = -dynamiclib
+WARN = -Wall -W -Wno-unused-parameter
+POPT = -O2
+BIN.SUFFIX =
+LIB.SONAME = lib$(NAME).$(SO_MAJOR).dylib
+LIB.DEVLNK = lib$(NAME).dylib
+LIB.SHARED = lib$(NAME).$(SO_VERSION).dylib
+LIB.STATIC = lib$(NAME).a
+LIB.FRAMEWORK = $(NAME)
+LDFLAGS.SO = $(LDFLAGS.DYNAMIC) -install_name $(REGAL_DEST)/lib/$(LIB.SHARED) -current_version $(SO_VERSION) -compatibility_version $(SO_MAJOR)
+LIB.SONAME.MX = lib$(NAME)mx.$(SO_MAJOR).dylib
+LIB.DEVLNK.MX = lib$(NAME)mx.dylib
+LIB.SHARED.MX = lib$(NAME)mx.$(SO_VERSION).dylib
+LIB.STATIC.MX = lib$(NAME)mx.a
+LDFLAGS.SO.MX = -dynamiclib -install_name $(REGAL_DEST)/lib/$(LIB.SHARED.MX) -current_version $(SO_VERSION) -compatibility_version $(SO_MAJOR)
View
30 config/Makefile.linux
@@ -0,0 +1,30 @@
+NAME = $(REGAL_NAME)
+CC = cc
+LD = cc
+EXT.DYNAMIC = so
+PICFLAG = -fPIC
+M_ARCH ?= $(shell uname -m)
+ifeq (x86_64,${M_ARCH})
+LDFLAGS.EXTRA = -L/usr/X11R6/lib64
+LIBDIR = $(REGAL_DEST)/lib64
+else
+LDFLAGS.EXTRA = -L/usr/X11R6/lib
+LIBDIR = $(REGAL_DEST)/lib
+endif
+LDFLAGS.GL = -lXmu -lXi -lGLU -lGL -lXext -lX11
+LDFLAGS.GLUT = -lglut
+LDFLAGS.STATIC =
+LDFLAGS.DYNAMIC = -shared
+WARN = -Wall -W -Wno-unused-parameter
+POPT = -O2
+BIN.SUFFIX =
+LIB.SONAME = lib$(NAME).so.$(SO_MAJOR)
+LIB.DEVLNK = lib$(NAME).so
+LIB.SHARED = lib$(NAME).so.$(SO_VERSION)
+LIB.STATIC = lib$(NAME).a
+LDFLAGS.SO = $(LDFLAGS.DYNAMIC) -Wl,-soname=$(LIB.SONAME)
+LIB.SONAME.MX = lib$(NAME)mx.so.$(SO_MAJOR)
+LIB.DEVLNK.MX = lib$(NAME)mx.so
+LIB.SHARED.MX = lib$(NAME)mx.so.$(SO_VERSION)
+LIB.STATIC.MX = lib$(NAME)mx.a
+LDFLAGS.SO.MX = $(LDFLAGS.DYNAMIC) -Wl,-soname=$(LIB.SONAME.MX)
View
32 config/Makefile.linux-32
@@ -0,0 +1,32 @@
+NAME = $(REGAL_NAME)
+CC = cc
+LD = cc
+EXT.DYNAMIC = so
+PICFLAG = -fPIC
+M_ARCH ?= $(shell uname -m)
+ifeq (x86_64,${M_ARCH})
+LDFLAGS.EXTRA = -L/usr/X11R6/lib64
+LIBDIR = $(REGAL_DEST)/lib64
+else
+LDFLAGS.EXTRA = -L/usr/X11R6/lib
+LIBDIR = $(REGAL_DEST)/lib
+endif
+CFLAGS.EXTRA += -m32
+LDFLAGS.EXTRA += -m32
+LDFLAGS.GL = -lXmu -lXi -lGLU -lGL -lXext -lX11
+LDFLAGS.GLUT = -lglut
+LDFLAGS.STATIC =
+LDFLAGS.DYNAMIC = -shared
+WARN = -Wall -W -Wno-unused-parameter
+POPT = -O2
+BIN.SUFFIX =
+LIB.SONAME = lib$(NAME).so.$(SO_MAJOR)
+LIB.DEVLNK = lib$(NAME).so
+LIB.SHARED = lib$(NAME).so.$(SO_VERSION)
+LIB.STATIC = lib$(NAME).a
+LDFLAGS.SO = $(LDFLAGS.DYNAMIC) -Wl,-soname=$(LIB.SONAME)
+LIB.SONAME.MX = lib$(NAME)mx.so.$(SO_MAJOR)
+LIB.DEVLNK.MX = lib$(NAME)mx.so
+LIB.SHARED.MX = lib$(NAME)mx.so.$(SO_VERSION)
+LIB.STATIC.MX = lib$(NAME)mx.a
+LDFLAGS.SO.MX = $(LDFLAGS.DYNAMIC) -Wl,-soname=$(LIB.SONAME.MX)
View
32 config/Makefile.linux-64
@@ -0,0 +1,32 @@
+NAME = $(REGAL_NAME)
+CC = cc
+LD = cc
+EXT.DYNAMIC = so
+PICFLAG = -fPIC
+M_ARCH ?= $(shell uname -m)
+ifeq (x86_64,${M_ARCH})
+LDFLAGS.EXTRA = -L/usr/X11R6/lib64
+LIBDIR = $(REGAL_DEST)/lib64
+else
+LDFLAGS.EXTRA = -L/usr/X11R6/lib
+LIBDIR = $(REGAL_DEST)/lib
+endif
+CFLAGS.EXTRA += -m64
+LDFLAGS.EXTRA += -m64
+LDFLAGS.GL = -lXmu -lXi -lGLU -lGL -lXext -lX11
+LDFLAGS.GLUT = -lglut
+LDFLAGS.STATIC =
+LDFLAGS.DYNAMIC = -shared
+WARN = -Wall -W -Wno-unused-parameter
+POPT = -O2
+BIN.SUFFIX =
+LIB.SONAME = lib$(NAME).so.$(SO_MAJOR)
+LIB.DEVLNK = lib$(NAME).so
+LIB.SHARED = lib$(NAME).so.$(SO_VERSION)
+LIB.STATIC = lib$(NAME).a
+LDFLAGS.SO = $(LDFLAGS.DYNAMIC) -Wl,-soname=$(LIB.SONAME)
+LIB.SONAME.MX = lib$(NAME)mx.so.$(SO_MAJOR)
+LIB.DEVLNK.MX = lib$(NAME)mx.so
+LIB.SHARED.MX = lib$(NAME)mx.so.$(SO_VERSION)
+LIB.STATIC.MX = lib$(NAME)mx.a
+LDFLAGS.SO.MX = $(LDFLAGS.DYNAMIC) -Wl,-soname=$(LIB.SONAME.MX)
View
1,523 config/config.guess
1,523 additions, 0 deletions not shown because the diff is too large. Please use a local Git client to view these changes.
View
7 config/version
@@ -0,0 +1,7 @@
+REGAL_MAJOR = 1
+REGAL_MINOR = 0
+REGAL_MICRO = 0
+REGAL_VERSION = $(REGAL_MAJOR).$(REGAL_MINOR).$(REGAL_MICRO)
+REGAL_NAME = Regal
+SO_MAJOR = $(REGAL_MAJOR).$(REGAL_MINOR)
+SO_VERSION = $(REGAL_VERSION)
View
8 examples/dreamtorus/android/.classpath
@@ -0,0 +1,8 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<classpath>
+ <classpathentry kind="src" path="src"/>
+ <classpathentry kind="src" path="gen"/>
+ <classpathentry kind="con" path="com.android.ide.eclipse.adt.ANDROID_FRAMEWORK"/>
+ <classpathentry kind="con" path="com.android.ide.eclipse.adt.LIBRARIES"/>
+ <classpathentry kind="output" path="bin/classes"/>
+</classpath>
View
33 examples/dreamtorus/android/.project
@@ -0,0 +1,33 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<projectDescription>
+ <name>minimalAndroid</name>
+ <comment></comment>
+ <projects>
+ </projects>
+ <buildSpec>
+ <buildCommand>
+ <name>com.android.ide.eclipse.adt.ResourceManagerBuilder</name>
+ <arguments>
+ </arguments>
+ </buildCommand>
+ <buildCommand>
+ <name>com.android.ide.eclipse.adt.PreCompilerBuilder</name>
+ <arguments>
+ </arguments>
+ </buildCommand>
+ <buildCommand>
+ <name>org.eclipse.jdt.core.javabuilder</name>
+ <arguments>
+ </arguments>
+ </buildCommand>
+ <buildCommand>
+ <name>com.android.ide.eclipse.adt.ApkBuilder</name>
+ <arguments>
+ </arguments>
+ </buildCommand>
+ </buildSpec>
+ <natures>
+ <nature>com.android.ide.eclipse.adt.AndroidNature</nature>
+ <nature>org.eclipse.jdt.core.javanature</nature>
+ </natures>
+</projectDescription>
View
38 examples/dreamtorus/android/AndroidManifest.xml
@@ -0,0 +1,38 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!--
+/*
+**
+** Copyright 2009, The Android Open Source Project
+**
+** Licensed under the Apache License, Version 2.0 (the "License");
+** you may not use this file except in compliance with the License.
+** You may obtain a copy of the License at
+**
+** http://www.apache.org/licenses/LICENSE-2.0
+**
+** Unless required by applicable law or agreed to in writing, software
+** distributed under the License is distributed on an "AS IS" BASIS,
+** WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+** See the License for the specific language governing permissions and
+** limitations under the License.
+*/
+-->
+
+<manifest xmlns:android="http://schemas.android.com/apk/res/android"
+ package="com.nvidia.minimalAndroid">
+ <application
+ android:label="@string/minimalAndroid_activity"
+ >
+ <activity android:name="MinimalAndroidActivity"
+ android:theme="@android:style/Theme.NoTitleBar.Fullscreen"
+ android:launchMode="singleTask"
+ android:configChanges="orientation|keyboardHidden">
+ <intent-filter>
+ <action android:name="android.intent.action.MAIN" />
+ <category android:name="android.intent.category.LAUNCHER" />
+ </intent-filter>
+ </activity>
+ </application>
+ <uses-feature android:glEsVersion="0x00020000"/>
+ <uses-sdk android:minSdkVersion="10"/>
+</manifest>
View
2 examples/dreamtorus/android/default.properties
@@ -0,0 +1,2 @@
+# Project target.
+target=android-15
View
45 examples/dreamtorus/android/jni/Android.mk
@@ -0,0 +1,45 @@
+# Copyright (C) 2009 The Android Open Source Project
+#
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+#
+LOCAL_PATH:= $(call my-dir)
+
+include $(CLEAR_VARS)
+
+LOCAL_MODULE := libminimalAndroid
+LOCAL_CFLAGS := -Werror
+LOCAL_ARM_MODE := arm
+
+REGAL_DIR := ../../../..
+REGAL_SRC = $(REGAL_DIR)/src/RegalIff.cpp
+REGAL_SRC += $(REGAL_DIR)/gen/Regal.cpp
+REGAL_SRC += $(REGAL_DIR)/gen/RegalEmuDispatch.cpp
+REGAL_SRC += $(REGAL_DIR)/gen/RegalErrorDispatch.cpp
+REGAL_SRC += $(REGAL_DIR)/gen/RegalLoaderDispatch.cpp
+REGAL_INC := $(REGAL_DIR)/gen $(REGAL_DIR)/src
+
+SHARED_DIR := ../../src
+
+REGAL_SRC_FILES := $(wildcard $(REGAL_DIR)/src/*.cpp $(REGAL_DIR)/gen/*.cpp)
+
+LOCAL_C_INCLUDES := $(patsubst %, $(LOCAL_PATH)/%, $(REGAL_INC) $(SHARED_DIR) )
+LOCAL_SRC_FILES := $(REGAL_SRC)
+LOCAL_SRC_FILES += gl_code.cpp $(SHARED_DIR)/render.cpp
+LOCAL_CFLAGS := -DANDROID=1
+LOCAL_LDLIBS := -llog
+
+#-lGLESv2
+
+include $(BUILD_SHARED_LIBRARY)
+
+
View
3 examples/dreamtorus/android/jni/Application.mk
@@ -0,0 +1,3 @@
+
+APP_STL := stlport_static
+
View
19 examples/dreamtorus/android/jni/Regal.mk
@@ -0,0 +1,19 @@
+LOCAL_PATH:= $(call my-dir)
+
+include $(CLEAR_VARS)
+
+LOCAL_MODULE := Regal
+LOCAL_CFLAGS := -Werror
+LOCAL_ARM_MODE := arm
+
+REGAL_DIR := ../../..
+REGAL_GEN := $(REGAL_DIR)/gen
+REGAL_SRC := $(REGAL_DIR)/src
+
+REGAL_SRC_FILES := $(wildcard $(REGAL_SRC)/*.cpp) $(wildcard $(REGAL_GEN)/*.cpp)
+
+LOCAL_C_INCLUDES := $(REGAL_GEN) $(REGAL_SRC)
+LOCAL_SRC_FILES := $(REGAL_SRC_FILES)
+LOCAL_CFLAGS := -DANDROID=1
+
+include $(BUILD_STATIC_LIBRARY)
View
197 examples/dreamtorus/android/jni/gl_code.cpp
@@ -0,0 +1,197 @@
+/*
+ * Copyright (C) 2009 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+// OpenGL ES 2.0 code
+
+#include <jni.h>
+#include <android/log.h>
+
+#include <GL/Regal.h>
+
+#include "render.h"
+
+#include <cmath>
+#include <cstdio>
+#include <cstdlib>
+
+#define LOG_TAG "libgl2jni"
+#define LOGI(...) __android_log_print(ANDROID_LOG_INFO,LOG_TAG,__VA_ARGS__)
+#define LOGE(...) __android_log_print(ANDROID_LOG_ERROR,LOG_TAG,__VA_ARGS__)
+
+static void printGLString(const char *name, GLenum s) {
+ const char *v = (const char *) glGetString(s);
+ LOGI("GL %s = %s\n", name, v);
+}
+
+static void checkGlError(const char* op) {
+ for (GLint error = glGetError(); error; error
+ = glGetError()) {
+ LOGI("after %s() glError (0x%x)\n", op, error);
+ }
+}
+
+static const char gVertexShader[] =
+ "attribute vec4 vPosition;\n"
+ "void main() {\n"
+ " gl_Position = vPosition;\n"
+ "}\n";
+
+static const char gFragmentShader[] =
+ "precision mediump float;\n"
+ "void main() {\n"
+ " gl_FragColor = vec4(0.0, 1.0, 0.0, 1.0);\n"
+ "}\n";
+
+GLuint loadShader(GLenum shaderType, const char* pSource) {
+ GLuint shader = glCreateShader(shaderType);
+ if (shader) {
+ glShaderSource(shader, 1, &pSource, NULL);
+ glCompileShader(shader);
+ GLint compiled = 0;
+ glGetShaderiv(shader, GL_COMPILE_STATUS, &compiled);
+ if (!compiled) {
+ GLint infoLen = 0;
+ glGetShaderiv(shader, GL_INFO_LOG_LENGTH, &infoLen);
+ if (infoLen) {
+ char* buf = (char*) malloc(infoLen);
+ if (buf) {
+ glGetShaderInfoLog(shader, infoLen, NULL, buf);
+ LOGE("Could not compile shader %d:\n%s\n",
+ shaderType, buf);
+ free(buf);
+ }
+ glDeleteShader(shader);
+ shader = 0;
+ }
+ }
+ }
+ return shader;
+}
+
+GLuint createProgram(const char* pVertexSource, const char* pFragmentSource) {
+ GLuint vertexShader = loadShader(GL_VERTEX_SHADER, pVertexSource);
+ if (!vertexShader) {
+ return 0;
+ }
+
+ GLuint pixelShader = loadShader(GL_FRAGMENT_SHADER, pFragmentSource);
+ if (!pixelShader) {
+ return 0;
+ }
+
+ GLuint program = glCreateProgram();
+ if (program) {
+ glAttachShader(program, vertexShader);
+ checkGlError("glAttachShader");
+ glAttachShader(program, pixelShader);
+ checkGlError("glAttachShader");
+ glLinkProgram(program);
+ GLint linkStatus = GL_FALSE;
+ glGetProgramiv(program, GL_LINK_STATUS, &linkStatus);
+ if (linkStatus != GL_TRUE) {
+ GLint bufLength = 0;
+ glGetProgramiv(program, GL_INFO_LOG_LENGTH, &bufLength);
+ if (bufLength) {
+ char* buf = (char*) malloc(bufLength);
+ if (buf) {
+ glGetProgramInfoLog(program, bufLength, NULL, buf);
+ LOGE("Could not link program:\n%s\n", buf);
+ free(buf);
+ }
+ }
+ glDeleteProgram(program);
+ program = 0;
+ }
+ }
+ return program;
+}
+
+GLuint gProgram;
+GLuint gvPositionHandle;
+
+static bool initialized = false;
+void initialize() {
+ if( initialized ) {
+ return;
+ }
+ initialized = true;
+ RegalMakeCurrent( eglGetCurrentContext() );
+}
+
+bool setupGraphics(int w, int h) {
+ initialize();
+ printGLString("Version", GL_VERSION);
+ printGLString("Vendor", GL_VENDOR);
+ printGLString("Renderer", GL_RENDERER);
+ printGLString("Extensions", GL_EXTENSIONS);
+
+ LOGI("setupGraphics(%d, %d)", w, h);
+ gProgram = createProgram(gVertexShader, gFragmentShader);
+ if (!gProgram) {
+ LOGE("Could not create program.");
+ return false;
+ }
+ gvPositionHandle = glGetAttribLocation(gProgram, "vPosition");
+ checkGlError("glGetAttribLocation");
+ LOGI("glGetAttribLocation(\"vPosition\") = %d\n",
+ gvPositionHandle);
+
+ reshape( w, h );
+ checkGlError("glViewport");
+ return true;
+}
+
+const GLfloat gTriangleVertices[] = { 0.0f, 0.5f, -0.5f, -0.5f,
+ 0.5f, -0.5f };
+
+void renderFrame() {
+ static float grey;
+ grey += 0.01f;
+ if (grey > 1.0f) {
+ grey = 0.0f;
+ }
+ glClearColor(grey, grey, grey, 1.0f);
+ checkGlError("glClearColor");
+ glClear( GL_DEPTH_BUFFER_BIT | GL_COLOR_BUFFER_BIT);
+ checkGlError("glClear");
+
+ glUseProgram(gProgram);
+ checkGlError("glUseProgram");
+
+ glVertexAttribPointer(gvPositionHandle, 2, GL_FLOAT, GL_FALSE, 0, gTriangleVertices);
+ checkGlError("glVertexAttribPointer");
+ glEnableVertexAttribArray(gvPositionHandle);
+ checkGlError("glEnableVertexAttribArray");
+ glDrawArrays(GL_TRIANGLES, 0, 3);
+ checkGlError("glDrawArrays");
+
+ display( false );
+}
+
+extern "C" {
+ JNIEXPORT void JNICALL Java_com_nvidia_minimalAndroid_MinimalAndroidLib_init(JNIEnv * env, jobject obj, jint width, jint height);
+ JNIEXPORT void JNICALL Java_com_nvidia_minimalAndroid_MinimalAndroidLib_step(JNIEnv * env, jobject obj);
+};
+
+JNIEXPORT void JNICALL Java_com_nvidia_minimalAndroid_MinimalAndroidLib_init(JNIEnv * env, jobject obj, jint width, jint height)
+{
+ setupGraphics(width, height);
+}
+
+JNIEXPORT void JNICALL Java_com_nvidia_minimalAndroid_MinimalAndroidLib_step(JNIEnv * env, jobject obj)
+{
+ renderFrame();
+}
View
11 examples/dreamtorus/android/project.properties
@@ -0,0 +1,11 @@
+# This file is automatically generated by Android Tools.
+# Do not modify this file -- YOUR CHANGES WILL BE ERASED!
+#
+# This file must be checked in Version Control Systems.
+#
+# To customize properties used by the Ant build system use,
+# "ant.properties", and override values to adapt the script to your
+# project structure.
+
+# Project target.
+target=android-10
View
29 examples/dreamtorus/android/res/values/strings.xml
@@ -0,0 +1,29 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!--
+/*
+**
+** Copyright 2006, The Android Open Source Project
+**
+** Licensed under the Apache License, Version 2.0 (the "License");
+** you may not use this file except in compliance with the License.
+** You may obtain a copy of the License at
+**
+** http://www.apache.org/licenses/LICENSE-2.0
+**
+** Unless required by applicable law or agreed to in writing, software
+** distributed under the License is distributed on an "AS IS" BASIS,
+** WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+** See the License for the specific language governing permissions and
+** limitations under the License.
+*/
+-->
+
+<!-- This file contains resource definitions for displayed strings, allowing
+ them to be changed based on the locale and options. -->
+
+<resources>
+ <!-- Simple strings. -->
+ <string name="minimalAndroid_activity">minimalAndroid</string>
+
+</resources>
+
View
46 examples/dreamtorus/android/src/com/nvidia/minimalAndroid/MinimalAndroidActivity.java
@@ -0,0 +1,46 @@
+/*
+ * Copyright (C) 2007 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package com.nvidia.minimalAndroid;
+
+import android.app.Activity;
+import android.os.Bundle;
+import android.util.Log;
+import android.view.WindowManager;
+
+import java.io.File;
+
+
+public class MinimalAndroidActivity extends Activity {
+
+ MinimalAndroidView mView;
+
+ @Override protected void onCreate(Bundle icicle) {
+ super.onCreate(icicle);
+ mView = new MinimalAndroidView(getApplication());
+ setContentView(mView);
+ }
+
+ @Override protected void onPause() {
+ super.onPause();
+ mView.onPause();
+ }
+
+ @Override protected void onResume() {
+ super.onResume();
+ mView.onResume();
+ }
+}
View
33 examples/dreamtorus/android/src/com/nvidia/minimalAndroid/MinimalAndroidLib.java
@@ -0,0 +1,33 @@
+/*
+ * Copyright (C) 2007 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package com.nvidia.minimalAndroid;
+
+// Wrapper for native library
+
+public class MinimalAndroidLib {
+
+ static {
+ System.loadLibrary("minimalAndroid");
+ }
+
+ /**
+ * @param width the current view width
+ * @param height the current view height
+ */
+ public static native void init(int width, int height);
+ public static native void step();
+}
View
339 examples/dreamtorus/android/src/com/nvidia/minimalAndroid/MinimalAndroidView.java
@@ -0,0 +1,339 @@
+/*
+ * Copyright (C) 2009 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package com.nvidia.minimalAndroid;
+/*
+ * Copyright (C) 2008 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+
+import android.content.Context;
+import android.graphics.PixelFormat;
+import android.opengl.GLSurfaceView;
+import android.util.AttributeSet;
+import android.util.Log;
+import android.view.KeyEvent;
+import android.view.MotionEvent;
+
+import javax.microedition.khronos.egl.EGL10;
+import javax.microedition.khronos.egl.EGLConfig;
+import javax.microedition.khronos.egl.EGLContext;
+import javax.microedition.khronos.egl.EGLDisplay;
+import javax.microedition.khronos.opengles.GL10;
+
+/**
+ * A simple GLSurfaceView sub-class that demonstrate how to perform
+ * OpenGL ES 2.0 rendering into a GL Surface. Note the following important
+ * details:
+ *
+ * - The class must use a custom context factory to enable 2.0 rendering.
+ * See ContextFactory class definition below.
+ *
+ * - The class must use a custom EGLConfigChooser to be able to select
+ * an EGLConfig that supports 2.0. This is done by providing a config
+ * specification to eglChooseConfig() that has the attribute
+ * EGL10.ELG_RENDERABLE_TYPE containing the EGL_OPENGL_ES2_BIT flag
+ * set. See ConfigChooser class definition below.
+ *
+ * - The class must select the surface's format, then choose an EGLConfig
+ * that matches it exactly (with regards to red/green/blue/alpha channels
+ * bit depths). Failure to do so would result in an EGL_BAD_MATCH error.
+ */
+class MinimalAndroidView extends GLSurfaceView {
+ private static String TAG = "MinimalAndroidView";
+ private static final boolean DEBUG = false;
+
+ public MinimalAndroidView(Context context) {
+ super(context);
+ init(false, 0, 0);
+ }
+
+ public MinimalAndroidView(Context context, boolean translucent, int depth, int stencil) {
+ super(context);
+ init(translucent, depth, stencil);
+ }
+
+ private void init(boolean translucent, int depth, int stencil) {
+
+ /* By default, GLSurfaceView() creates a RGB_565 opaque surface.
+ * If we want a translucent one, we should change the surface's
+ * format here, using PixelFormat.TRANSLUCENT for GL Surfaces
+ * is interpreted as any 32-bit surface with alpha by SurfaceFlinger.
+ */
+ if (translucent) {
+ this.getHolder().setFormat(PixelFormat.TRANSLUCENT);
+ }
+
+ /* Setup the context factory for 2.0 rendering.
+ * See ContextFactory class definition below
+ */
+ setEGLContextFactory(new ContextFactory());
+
+ /* We need to choose an EGLConfig that matches the format of
+ * our surface exactly. This is going to be done in our
+ * custom config chooser. See ConfigChooser class definition
+ * below.
+ */
+ setEGLConfigChooser( translucent ?
+ new ConfigChooser(8, 8, 8, 8, depth, stencil) :
+ new ConfigChooser(5, 6, 5, 0, depth, stencil) );
+
+ /* Set the renderer responsible for frame rendering */
+ setRenderer(new Renderer());
+ }
+
+ private static class ContextFactory implements GLSurfaceView.EGLContextFactory {
+ private static int EGL_CONTEXT_CLIENT_VERSION = 0x3098;
+ public EGLContext createContext(EGL10 egl, EGLDisplay display, EGLConfig eglConfig) {
+ Log.w(TAG, "creating OpenGL ES 2.0 context");
+ checkEglError("Before eglCreateContext", egl);
+ int[] attrib_list = {EGL_CONTEXT_CLIENT_VERSION, 2, EGL10.EGL_NONE };
+ EGLContext context = egl.eglCreateContext(display, eglConfig, EGL10.EGL_NO_CONTEXT, attrib_list);
+ checkEglError("After eglCreateContext", egl);
+ return context;
+ }
+
+ public void destroyContext(EGL10 egl, EGLDisplay display, EGLContext context) {
+ egl.eglDestroyContext(display, context);
+ }
+ }
+
+ private static void checkEglError(String prompt, EGL10 egl) {
+ int error;
+ while ((error = egl.eglGetError()) != EGL10.EGL_SUCCESS) {
+ Log.e(TAG, String.format("%s: EGL error: 0x%x", prompt, error));
+ }
+ }
+
+ private static class ConfigChooser implements GLSurfaceView.EGLConfigChooser {
+
+ public ConfigChooser(int r, int g, int b, int a, int depth, int stencil) {
+ mRedSize = r;
+ mGreenSize = g;
+ mBlueSize = b;
+ mAlphaSize = a;
+ mDepthSize = depth;
+ mStencilSize = stencil;
+ }
+
+ /* This EGL config specification is used to specify 2.0 rendering.
+ * We use a minimum size of 4 bits for red/green/blue, but will
+ * perform actual matching in chooseConfig() below.
+ */
+ private static int EGL_OPENGL_ES2_BIT = 4;
+ private static int[] s_configAttribs2 =
+ {
+ EGL10.EGL_RED_SIZE, 4,
+ EGL10.EGL_GREEN_SIZE, 4,
+ EGL10.EGL_BLUE_SIZE, 4,
+ EGL10.EGL_RENDERABLE_TYPE, EGL_OPENGL_ES2_BIT,
+ EGL10.EGL_NONE
+ };
+
+ public EGLConfig chooseConfig(EGL10 egl, EGLDisplay display) {
+
+ /* Get the number of minimally matching EGL configurations
+ */
+ int[] num_config = new int[1];
+ egl.eglChooseConfig(display, s_configAttribs2, null, 0, num_config);
+
+ int numConfigs = num_config[0];
+
+ if (numConfigs <= 0) {
+ throw new IllegalArgumentException("No configs match configSpec");
+ }
+
+ /* Allocate then read the array of minimally matching EGL configs
+ */
+ EGLConfig[] configs = new EGLConfig[numConfigs];
+ egl.eglChooseConfig(display, s_configAttribs2, configs, numConfigs, num_config);
+
+ if (DEBUG) {
+ printConfigs(egl, display, configs);
+ }
+ /* Now return the "best" one
+ */
+ return chooseConfig(egl, display, configs);
+ }
+
+ public EGLConfig chooseConfig(EGL10 egl, EGLDisplay display,
+ EGLConfig[] configs) {
+ for(EGLConfig config : configs) {
+ int d = findConfigAttrib(egl, display, config,
+ EGL10.EGL_DEPTH_SIZE, 0);
+ int s = findConfigAttrib(egl, display, config,
+ EGL10.EGL_STENCIL_SIZE, 0);
+
+ // We need at least mDepthSize and mStencilSize bits
+ if (d < mDepthSize || s < mStencilSize)
+ continue;
+
+ // We want an *exact* match for red/green/blue/alpha
+ int r = findConfigAttrib(egl, display, config,
+ EGL10.EGL_RED_SIZE, 0);
+ int g = findConfigAttrib(egl, display, config,
+ EGL10.EGL_GREEN_SIZE, 0);
+ int b = findConfigAttrib(egl, display, config,
+ EGL10.EGL_BLUE_SIZE, 0);
+ int a = findConfigAttrib(egl, display, config,
+ EGL10.EGL_ALPHA_SIZE, 0);
+
+ if (r == mRedSize && g == mGreenSize && b == mBlueSize && a == mAlphaSize)
+ return config;
+ }
+ return null;
+ }
+
+ private int findConfigAttrib(EGL10 egl, EGLDisplay display,
+ EGLConfig config, int attribute, int defaultValue) {
+
+ if (egl.eglGetConfigAttrib(display, config, attribute, mValue)) {
+ return mValue[0];
+ }
+ return defaultValue;
+ }
+
+ private void printConfigs(EGL10 egl, EGLDisplay display,
+ EGLConfig[] configs) {
+ int numConfigs = configs.length;
+ Log.w(TAG, String.format("%d configurations", numConfigs));
+ for (int i = 0; i < numConfigs; i++) {
+ Log.w(TAG, String.format("Configuration %d:\n", i));
+ printConfig(egl, display, configs[i]);
+ }
+ }
+
+ private void printConfig(EGL10 egl, EGLDisplay display,
+ EGLConfig config) {
+ int[] attributes = {
+ EGL10.EGL_BUFFER_SIZE,
+ EGL10.EGL_ALPHA_SIZE,
+ EGL10.EGL_BLUE_SIZE,
+ EGL10.EGL_GREEN_SIZE,
+ EGL10.EGL_RED_SIZE,
+ EGL10.EGL_DEPTH_SIZE,
+ EGL10.EGL_STENCIL_SIZE,
+ EGL10.EGL_CONFIG_CAVEAT,
+ EGL10.EGL_CONFIG_ID,
+ EGL10.EGL_LEVEL,
+ EGL10.EGL_MAX_PBUFFER_HEIGHT,
+ EGL10.EGL_MAX_PBUFFER_PIXELS,
+ EGL10.EGL_MAX_PBUFFER_WIDTH,
+ EGL10.EGL_NATIVE_RENDERABLE,
+ EGL10.EGL_NATIVE_VISUAL_ID,
+ EGL10.EGL_NATIVE_VISUAL_TYPE,
+ 0x3030, // EGL10.EGL_PRESERVED_RESOURCES,
+ EGL10.EGL_SAMPLES,
+ EGL10.EGL_SAMPLE_BUFFERS,
+ EGL10.EGL_SURFACE_TYPE,
+ EGL10.EGL_TRANSPARENT_TYPE,
+ EGL10.EGL_TRANSPARENT_RED_VALUE,
+ EGL10.EGL_TRANSPARENT_GREEN_VALUE,
+ EGL10.EGL_TRANSPARENT_BLUE_VALUE,
+ 0x3039, // EGL10.EGL_BIND_TO_TEXTURE_RGB,
+ 0x303A, // EGL10.EGL_BIND_TO_TEXTURE_RGBA,
+ 0x303B, // EGL10.EGL_MIN_SWAP_INTERVAL,
+ 0x303C, // EGL10.EGL_MAX_SWAP_INTERVAL,
+ EGL10.EGL_LUMINANCE_SIZE,
+ EGL10.EGL_ALPHA_MASK_SIZE,
+ EGL10.EGL_COLOR_BUFFER_TYPE,
+ EGL10.EGL_RENDERABLE_TYPE,
+ 0x3042 // EGL10.EGL_CONFORMANT
+ };
+ String[] names = {
+ "EGL_BUFFER_SIZE",
+ "EGL_ALPHA_SIZE",
+ "EGL_BLUE_SIZE",
+ "EGL_GREEN_SIZE",
+ "EGL_RED_SIZE",
+ "EGL_DEPTH_SIZE",
+ "EGL_STENCIL_SIZE",
+ "EGL_CONFIG_CAVEAT",
+ "EGL_CONFIG_ID",
+ "EGL_LEVEL",
+ "EGL_MAX_PBUFFER_HEIGHT",
+ "EGL_MAX_PBUFFER_PIXELS",
+ "EGL_MAX_PBUFFER_WIDTH",
+ "EGL_NATIVE_RENDERABLE",
+ "EGL_NATIVE_VISUAL_ID",
+ "EGL_NATIVE_VISUAL_TYPE",
+ "EGL_PRESERVED_RESOURCES",
+ "EGL_SAMPLES",
+ "EGL_SAMPLE_BUFFERS",
+ "EGL_SURFACE_TYPE",
+ "EGL_TRANSPARENT_TYPE",
+ "EGL_TRANSPARENT_RED_VALUE",
+ "EGL_TRANSPARENT_GREEN_VALUE",
+ "EGL_TRANSPARENT_BLUE_VALUE",
+ "EGL_BIND_TO_TEXTURE_RGB",
+ "EGL_BIND_TO_TEXTURE_RGBA",
+ "EGL_MIN_SWAP_INTERVAL",
+ "EGL_MAX_SWAP_INTERVAL",
+ "EGL_LUMINANCE_SIZE",
+ "EGL_ALPHA_MASK_SIZE",
+ "EGL_COLOR_BUFFER_TYPE",
+ "EGL_RENDERABLE_TYPE",
+ "EGL_CONFORMANT"
+ };
+ int[] value = new int[1];
+ for (int i = 0; i < attributes.length; i++) {
+ int attribute = attributes[i];
+ String name = names[i];
+ if ( egl.eglGetConfigAttrib(display, config, attribute, value)) {
+ Log.w(TAG, String.format(" %s: %d\n", name, value[0]));
+ } else {
+ // Log.w(TAG, String.format(" %s: failed\n", name));
+ while (egl.eglGetError() != EGL10.EGL_SUCCESS);
+ }
+ }
+ }
+
+ // Subclasses can adjust these values:
+ protected int mRedSize;
+ protected int mGreenSize;
+ protected int mBlueSize;
+ protected int mAlphaSize;
+ protected int mDepthSize;
+ protected int mStencilSize;
+ private int[] mValue = new int[1];
+ }
+
+ private static class Renderer implements GLSurfaceView.Renderer {
+ public void onDrawFrame(GL10 gl) {
+ MinimalAndroidLib.step();
+ }
+
+ public void onSurfaceChanged(GL10 gl, int width, int height) {
+ MinimalAndroidLib.init(width, height);
+ }
+
+ public void onSurfaceCreated(GL10 gl, EGLConfig config) {
+ // Do nothing.
+ }
+ }
+}
View
63 examples/dreamtorus/glut/code/main.cpp
@@ -0,0 +1,63 @@
+//
+// main.cpp
+// minimal_glut
+//
+// Created by Cass Everitt on 2/1/12.
+// Copyright (c) 2012 n/a. All rights reserved.
+//
+
+#include <GL/Regal.h>
+
+#ifdef __APPLE__
+#include <GLUT/glut.h>
+#else
+#include <GL/RegalGLUT.h>
+#endif
+
+#include "render.h"
+
+#include <cstdlib>
+
+static void myDisplay()
+{
+ display(true);
+ glutSwapBuffers();
+}
+
+static void myTick(int dummy)
+{
+ glutPostRedisplay();
+ glutTimerFunc( 16, myTick, 0 );
+}
+
+static void myKeyboard(unsigned char c, int x, int y)
+{
+ switch (c)
+ {
+ case 'q':
+ case 27: /* Esc key */
+ exit(0);
+ break;
+ }
+}
+
+int main(int argc, const char *argv[])
+{
+ glutInitDisplayString("rgba>=8 depth double");
+ glutInitWindowSize(500, 500);
+ glutInit( &argc, (char **) argv);
+ glutCreateWindow("dreamtorus");
+
+ // Regal workaround for OSX GLUT
+
+ #ifdef __APPLE__
+ RegalMakeCurrent(CGLGetCurrentContext());
+ #endif
+
+ glutTimerFunc(16, myTick, 0);
+ glutDisplayFunc(myDisplay);
+ glutReshapeFunc(reshape);
+ glutKeyboardFunc(myKeyboard);
+ glutMainLoop();
+ return 0;
+}
View
36 examples/dreamtorus/glx/Makefile
@@ -0,0 +1,36 @@
+
+all: dreamtorus
+
+clean:
+ rm -f dreamtorus
+ rm -rf obj
+
+REGAL_DIR := ../../../../regal
+REGAL_SRC := $(wildcard $(REGAL_DIR)/gen/*.cpp $(REGAL_DIR)/src/*.cpp)
+REGAL_INC := $(REGAL_DIR)/gen $(REGAL_DIR)/src
+
+SHARED_DIR := ../src
+SHARED_SRC := $(wildcard $(SHARED_DIR)/*.cpp)
+SHARED_INC := $(SHARED_DIR)
+
+LOCAL_SRC := $(wildcard *.cpp)
+
+MY_SRC := $(REGAL_SRC) $(LOCAL_SRC) $(SHARED_SRC)
+MY_SRC_DIRS := $(sort $(dir $(MY_SRC)))
+
+MY_OBJ := $(MY_SRC)
+MY_OBJ := $(patsubst %.cpp, obj$(CURDIR)/%.o, $(MY_OBJ))
+MY_OBJ := $(patsubst %.c, obj$(CURDIR)/%.o, $(MY_OBJ))
+MY_OBJ_DIRS := $(sort $(dir $(MY_OBJ)))
+
+MY_INC := $(REGAL_INC) $(SHARED_INC)
+MY_CMD_INC := $(patsubst %, -I %, $(MY_INC))
+
+obj$(CURDIR)/%.o: %.cpp
+ @mkdir -p $(dir $@)
+ g++ -g -c -o $@ $(MY_CMD_INC) $<
+ @echo $@ ---- $<
+
+dreamtorus: $(MY_OBJ)
+ g++ -g -o $@ $(MY_OBJ) -lX11 -lpthread
+
View
105 examples/dreamtorus/glx/main.cpp
@@ -0,0 +1,105 @@
+#include <X11/Xdefs.h>
+#include <X11/Xutil.h>
+
+typedef XID GLXDrawable;
+#include <GL/Regal.h>
+#include "render.h"
+#include <unistd.h>
+
+#include <cstdlib>
+#include <cstring>
+#include <cstdio>
+
+int main (int argc, char ** argv)
+{
+ Display *dpy = XOpenDisplay(0);
+
+ PFNGLXCREATECONTEXTATTRIBSARBPROC glXCreateContextAttribsARB = NULL;
+
+ const char *extensions = glXQueryExtensionsString(dpy, DefaultScreen(dpy));
+ printf("%s\n",extensions);
+
+ static int visual_attribs[] =
+ {
+ GLX_RENDER_TYPE, GLX_RGBA_BIT,
+ GLX_DRAWABLE_TYPE, GLX_WINDOW_BIT,
+ GLX_DOUBLEBUFFER, true,
+ GLX_RED_SIZE, 1,
+ GLX_GREEN_SIZE, 1,
+ GLX_BLUE_SIZE, 1,
+ None
+ };
+
+ printf("Getting framebuffer config.\n");
+ int fbcount;
+ GLXFBConfig *fbc = glXChooseFBConfig(dpy, DefaultScreen(dpy), visual_attribs, &fbcount);
+ if (!fbc)
+ {
+ printf("Failed to retrieve a framebuffer config.\n");
+ return 1;
+ }
+
+ printf("Getting XVisualInfo\n");
+ XVisualInfo *vi = glXGetVisualFromFBConfig(dpy, fbc[0]);
+
+ XSetWindowAttributes swa;
+ printf("Creating colormap\n");
+ swa.colormap = XCreateColormap(dpy, RootWindow(dpy, vi->screen), vi->visual, AllocNone);
+ swa.border_pixel = 0;
+ swa.event_mask = StructureNotifyMask;
+
+ printf("Creating window\n");
+ int width = 500;
+ int height = 500;
+ Window win = XCreateWindow(dpy, RootWindow(dpy, vi->screen), 0, 0, width, height, 0, vi->depth, InputOutput, vi->visual, CWBorderPixel|CWColormap|CWEventMask, &swa);
+ if (!win)
+ {
+ printf("Failed to create window\n");
+ return 1;
+ }
+
+ printf("Mapping window\n");
+ XMapWindow(dpy, win);
+
+ // Create an oldstyle context first, to get the correct function pointer for glXCreateContextAttribsARB
+ GLXContext ctx_old = glXCreateContext(dpy, vi, 0, GL_TRUE);
+ glXCreateContextAttribsARB = (PFNGLXCREATECONTEXTATTRIBSARBPROC) glXGetProcAddress((const GLubyte*)"glXCreateContextAttribsARB");
+ printf("glxCreateContextAttribsARB %p\n",glXCreateContextAttribsARB);
+ glXMakeCurrent(dpy, 0, 0);
+ glXDestroyContext(dpy, ctx_old);
+
+ if (glXCreateContextAttribsARB == NULL)
+ {
+ printf("glXCreateContextAttribsARB entry point not found. Aborting.\n");
+ return false;
+ }
+
+ static int context_attribs[] =
+ {
+ GLX_CONTEXT_MAJOR_VERSION_ARB, 3,
+ GLX_CONTEXT_MINOR_VERSION_ARB, 0,
+ None
+ };
+
+ printf("Creating context\n");
+ GLXContext ctx = glXCreateContextAttribsARB(dpy, fbc[0], NULL, true, context_attribs);
+ if (!ctx)
+ {
+ printf("Failed to create GL3 context.\n");
+ return 1;
+ }
+
+ printf("Making context current.\n");
+ glXMakeCurrent(dpy, win, ctx);
+
+ reshape( width, height );
+ for(int i = 0; i < 1000000; i++ ) {
+ display( true );
+ usleep( 16000 );
+ glXSwapBuffers( dpy, win );
+ }
+
+ ctx = glXGetCurrentContext();
+ glXMakeCurrent(dpy, 0, 0);
+ glXDestroyContext(dpy, ctx);
+}
View
16 examples/dreamtorus/ios/RGLOpenGLContext.h
@@ -0,0 +1,16 @@
+/* Copyright (c) 2006-2007 Christopher J. W. Lloyd
+
+Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
+
+The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */
+
+#import <OpenGLES/EAGL.h>
+
+@interface RGLOpenGLContext : NSObject {
+}
+
++ (BOOL) setCurrentContext:(EAGLContext*) context;
+
+@end
View
15 examples/dreamtorus/ios/RGLOpenGLContext.m
@@ -0,0 +1,15 @@
+#import "RGLOpenGLContext.h"
+
+
+void RegalMakeCurrent( void * sysctx );
+
+@implementation RGLOpenGLContext
+
++ (BOOL)setCurrentContext: (EAGLContext*) context
+{
+ BOOL res = [EAGLContext setCurrentContext: context];
+ RegalMakeCurrent( (void *)context );
+ return res;
+}
+
+@end
View
34 examples/dreamtorus/ios/minimal_ios/EAGLView.h
@@ -0,0 +1,34 @@
+//
+// EAGLView.h
+// OpenGLES_iPhone
+//
+// Created by mmalc Crawford on 11/18/10.
+// Copyright 2010 Apple Inc. All rights reserved.
+//
+
+#import <UIKit/UIKit.h>
+#import <OpenGLES/ES1/gl.h>
+#import <OpenGLES/ES1/glext.h>
+#import <OpenGLES/ES2/gl.h>
+#import <OpenGLES/ES2/glext.h>
+
+@class EAGLContext;
+
+// This class wraps the CAEAGLLayer from CoreAnimation into a convenient UIView subclass.
+// The view content is basically an EAGL surface you render your OpenGL scene into.
+// Note that setting the view non-opaque will only work if the EAGL surface has an alpha channel.
+@interface EAGLView : UIView {
+ // The pixel dimensions of the CAEAGLLayer.
+ GLint framebufferWidth;
+ GLint framebufferHeight;
+
+ // The OpenGL ES names for the framebuffer and renderbuffer used to render to this view.
+ GLuint defaultFramebuffer, colorRenderbuffer, depthRenderbuffer;
+}
+
+@property (nonatomic, retain) EAGLContext *context;
+
+- (void)setFramebuffer;
+- (BOOL)presentFramebuffer;
+
+@end
View
148 examples/dreamtorus/ios/minimal_ios/EAGLView.mm
@@ -0,0 +1,148 @@
+//
+// EAGLView.m
+// OpenGLES_iPhone
+//
+// Created by mmalc Crawford on 11/18/10.
+// Copyright 2010 Apple Inc. All rights reserved.
+//
+
+#import "EAGLView.h"
+#import "RGLOpenGLContext.h"
+
+#import <QuartzCore/QuartzCore.h>
+
+#include "render.h"
+
+
+@interface EAGLView (PrivateMethods)
+- (void)createFramebuffer;
+- (void)deleteFramebuffer;
+@end
+
+@implementation EAGLView
+
+@synthesize context;
+
+// You must implement this method
++ (Class)layerClass
+{
+ return [CAEAGLLayer class];
+}
+
+//The EAGL view is stored in the nib file. When it's unarchived it's sent -initWithCoder:.
+- (id)initWithCoder:(NSCoder*)coder
+{
+ self = [super initWithCoder:coder];
+ if (self) {
+ CAEAGLLayer *eaglLayer = (CAEAGLLayer *)self.layer;
+
+ eaglLayer.opaque = TRUE;
+ eaglLayer.drawableProperties = [NSDictionary dictionaryWithObjectsAndKeys:
+ [NSNumber numberWithBool:FALSE], kEAGLDrawablePropertyRetainedBacking,
+ kEAGLColorFormatRGBA8, kEAGLDrawablePropertyColorFormat,
+ nil];
+ }
+
+ return self;
+}
+
+- (void)dealloc
+{
+ [self deleteFramebuffer];
+ [context release];
+
+ [super dealloc];
+}
+
+- (void)setContext:(EAGLContext *)newContext
+{
+ if (context != newContext) {
+ [self deleteFramebuffer];
+
+ [context release];
+ context = [newContext retain];
+
+ [RGLOpenGLContext setCurrentContext:nil];
+ }
+}
+
+- (void)createFramebuffer
+{
+ if (context && !defaultFramebuffer) {
+ [RGLOpenGLContext setCurrentContext:context];
+
+ // Create default framebuffer object.
+ glGenFramebuffers(1, &defaultFramebuffer);
+ glBindFramebuffer(GL_FRAMEBUFFER, defaultFramebuffer);
+
+ // Create color render buffer and allocate backing store.
+ glGenRenderbuffers(1, &colorRenderbuffer);
+ glBindRenderbuffer(GL_RENDERBUFFER, colorRenderbuffer);
+ [context renderbufferStorage:GL_RENDERBUFFER fromDrawable:(CAEAGLLayer *)self.layer];
+ glGetRenderbufferParameteriv(GL_RENDERBUFFER, GL_RENDERBUFFER_WIDTH, &framebufferWidth);
+ glGetRenderbufferParameteriv(GL_RENDERBUFFER, GL_RENDERBUFFER_HEIGHT, &framebufferHeight);
+ glFramebufferRenderbuffer(GL_FRAMEBUFFER, GL_COLOR_ATTACHMENT0, GL_RENDERBUFFER, colorRenderbuffer);
+
+ glGenRenderbuffersOES(1, &depthRenderbuffer);
+ glBindRenderbufferOES(GL_RENDERBUFFER, depthRenderbuffer);
+ glRenderbufferStorage(GL_RENDERBUFFER, GL_DEPTH_COMPONENT16, framebufferWidth, framebufferHeight);
+ glFramebufferRenderbuffer(GL_FRAMEBUFFER, GL_DEPTH_ATTACHMENT, GL_RENDERBUFFER, depthRenderbuffer);
+
+
+ if (glCheckFramebufferStatus(GL_FRAMEBUFFER) != GL_FRAMEBUFFER_COMPLETE)
+ NSLog(@"Failed to make complete framebuffer object %x", glCheckFramebufferStatus(GL_FRAMEBUFFER));
+ }
+}
+
+- (void)deleteFramebuffer
+{
+ if (context) {
+ [RGLOpenGLContext setCurrentContext:context];
+
+ if (defaultFramebuffer) {
+ glDeleteFramebuffers(1, &defaultFramebuffer);
+ defaultFramebuffer = 0;
+ }
+
+ if (colorRenderbuffer) {
+ glDeleteRenderbuffers(1, &colorRenderbuffer);
+ colorRenderbuffer = 0;
+ }
+ }
+}
+
+- (void)setFramebuffer
+{
+ if (context) {
+ [RGLOpenGLContext setCurrentContext:context];
+
+ if (!defaultFramebuffer)
+ [self createFramebuffer];
+
+ glBindFramebuffer(GL_FRAMEBUFFER, defaultFramebuffer);
+ reshape( framebufferWidth, framebufferHeight);
+ }
+}
+
+- (BOOL)presentFramebuffer
+{
+ BOOL success = FALSE;
+
+ if (context) {
+ [RGLOpenGLContext setCurrentContext:context];
+
+ glBindRenderbuffer(GL_RENDERBUFFER, colorRenderbuffer);
+
+ success = [context presentRenderbuffer:GL_RENDERBUFFER];
+ }
+
+ return success;
+}
+
+- (void)layoutSubviews
+{
+ // The framebuffer will be re-created at the beginning of the next setFramebuffer method call.
+ [self deleteFramebuffer];
+}
+
+@end
View
7 examples/dreamtorus/ios/minimal_ios/Shaders/Shader.fsh
@@ -0,0 +1,7 @@
+
+in vec4 colorVarying;
+
+void main()
+{
+ gl_FragColor = colorVarying;
+}
View
16 examples/dreamtorus/ios/minimal_ios/Shaders/Shader.vsh
@@ -0,0 +1,16 @@
+
+in vec4 position;
+in vec4 color;
+
+out vec4 colorVarying;
+
+uniform float translate;
+
+void main()
+{
+ gl_Position = position;
+ gl_Position.y += sin(translate) / 2.0;
+ gl_Position.z = 0.9;
+
+ colorVarying = color;
+}
View
2 examples/dreamtorus/ios/minimal_ios/en.lproj/InfoPlist.strings
@@ -0,0 +1,2 @@
+/* Localized versions of Info.plist keys */
+
View
196 examples/dreamtorus/ios/minimal_ios/en.lproj/MainWindow.xib
@@ -0,0 +1,196 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<archive type="com.apple.InterfaceBuilder3.CocoaTouch.XIB" version="7.10">
+ <data>
+ <int key="IBDocument.SystemTarget">1056</int>
+ <string key="IBDocument.SystemVersion">10H574</string>
+ <string key="IBDocument.InterfaceBuilderVersion">1248</string>
+ <string key="IBDocument.AppKitVersion">1038.35</string>
+ <string key="IBDocument.HIToolboxVersion">461.00</string>
+ <object class="NSMutableDictionary" key="IBDocument.PluginVersions">
+ <string key="NS.key.0">com.apple.InterfaceBuilder.IBCocoaTouchPlugin</string>
+ <string key="NS.object.0">106</string>
+ </object>
+ <object class="NSArray" key="IBDocument.IntegratedClassDependencies">
+ <bool key="EncodedWithXMLCoder">YES</bool>
+ <string>IBUIWindow</string>
+ <string>IBUICustomObject</string>
+ <string>IBUIViewController</string>
+ <string>IBProxyObject</string>
+ </object>
+ <object class="NSArray" key="IBDocument.PluginDependencies">
+ <bool key="EncodedWithXMLCoder">YES</bool>
+ <string>com.apple.InterfaceBuilder.IBCocoaTouchPlugin</string>
+ </object>
+ <object class="NSMutableDictionary" key="IBDocument.Metadata">
+ <bool key="EncodedWithXMLCoder">YES</bool>
+ <object class="NSArray" key="dict.sortedKeys" id="0">
+ <bool key="EncodedWithXMLCoder">YES</bool>
+ </object>
+ <reference key="dict.values" ref="0"/>
+ </object>
+ <object class="NSMutableArray" key="IBDocument.RootObjects" id="1000">
+ <bool key="EncodedWithXMLCoder">YES</bool>
+ <object class="IBProxyObject" id="841351856">
+ <string key="IBProxiedObjectIdentifier">IBFilesOwner</string>
+ <string key="targetRuntimeIdentifier">IBCocoaTouchFramework</string>
+ </object>
+ <object class="IBProxyObject" id="191355593">
+ <string key="IBProxiedObjectIdentifier">IBFirstResponder</string>
+ <string key="targetRuntimeIdentifier">IBCocoaTouchFramework</string>
+ </object>
+ <object class="IBUICustomObject" id="664661524">
+ <string key="targetRuntimeIdentifier">IBCocoaTouchFramework</string>
+ </object>
+ <object class="IBUIViewController" id="692423605">
+ <string key="IBUINibName">minimal_iosViewController</string>
+ <object class="IBUISimulatedOrientationMetrics" key="IBUISimulatedOrientationMetrics">
+ <int key="IBUIInterfaceOrientation">1</int>
+ <int key="interfaceOrientation">1</int>
+ </object>
+ <bool key="IBUIWantsFullScreenLayout">YES</bool>
+ <string key="targetRuntimeIdentifier">IBCocoaTouchFramework</string>
+ <bool key="IBUIHorizontal">NO</bool>
+ </object>
+ <object class="IBUIWindow" id="380026005">
+ <nil key="NSNextResponder"/>
+ <int key="NSvFlags">1316</int>
+ <object class="NSPSMatrix" key="NSFrameMatrix"/>
+ <string key="NSFrameSize">{320, 460}</string>
+ <object class="NSColor" key="IBUIBackgroundColor">
+ <int key="NSColorSpace">1</int>
+ <bytes key="NSRGB">MSAxIDEAA</bytes>
+ </object>
+ <bool key="IBUIClearsContextBeforeDrawing">NO</bool>
+ <string key="targetRuntimeIdentifier">IBCocoaTouchFramework</string>
+ <bool key="IBUIVisibleAtLaunch">YES</bool>
+ <bool key="IBUIResizesToFullScreen">YES</bool>
+ </object>
+ </object>
+ <object class="IBObjectContainer" key="IBDocument.Objects">
+ <object class="NSMutableArray" key="connectionRecords">
+ <bool key="EncodedWithXMLCoder">YES</bool>
+ <object class="IBConnectionRecord">
+ <object class="IBCocoaTouchOutletConnection" key="connection">
+ <string key="label">delegate</string>
+ <reference key="source" ref="841351856"/>
+ <reference key="destination" ref="664661524"/>
+ </object>
+ <int key="connectionID">4</int>
+ </object>
+ <object class="IBConnectionRecord">
+ <object class="IBCocoaTouchOutletConnection" key="connection">
+ <string key="label">window</string>
+ <reference key="source" ref="664661524"/>
+ <reference key="destination" ref="380026005"/>
+ </object>
+ <int key="connectionID">5</int>
+ </object>
+ <object class="IBConnectionRecord">
+ <object class="IBCocoaTouchOutletConnection" key="connection">
+ <string key="label">viewController</string>
+ <reference key="source" ref="664661524"/>
+ <reference key="destination" ref="692423605"/>
+ </object>
+ <int key="connectionID">11</int>
+ </object>
+ </object>
+ <object class="IBMutableOrderedSet" key="objectRecords">
+ <object class="NSArray" key="orderedObjects">
+ <bool key="EncodedWithXMLCoder">YES</bool>
+ <object class="IBObjectRecord">
+ <int key="objectID">0</int>
+ <reference key="object" ref="0"/>
+ <reference key="children" ref="1000"/>
+ <nil key="parent"/>
+ </object>
+ <object class="IBObjectRecord">
+ <int key="objectID">2</int>
+ <reference key="object" ref="380026005"/>
+ <object class="NSMutableArray" key="children">
+ <bool key="EncodedWithXMLCoder">YES</bool>
+ </object>
+ <reference key="parent" ref="0"/>
+ </object>
+ <object class="IBObjectRecord">
+ <int key="objectID">-1</int>
+ <reference key="object" ref="841351856"/>
+ <reference key="parent" ref="0"/>
+ <string key="objectName">File's Owner</string>
+ </object>
+ <object class="IBObjectRecord">
+ <int key="objectID">3</int>
+ <reference key="object" ref="664661524"/>
+ <reference key="parent" ref="0"/>
+ </object>
+ <object class="IBObjectRecord">
+ <int key="objectID">-2</int>
+ <reference key="object" ref="191355593"/>
+ <reference key="parent" ref="0"/>
+ </object>
+ <object class="IBObjectRecord">
+ <int key="objectID">10</int>
+ <reference key="object" ref="692423605"/>
+ <reference key="parent" ref="0"/>
+ </object>
+ </object>
+ </object>
+ <object class="NSMutableDictionary" key="flattenedProperties">
+ <bool key="EncodedWithXMLCoder">YES</bool>
+ <object class="NSArray" key="dict.sortedKeys">
+ <bool key="EncodedWithXMLCoder">YES</bool>
+ <string>-1.CustomClassName</string>
+ <string>-2.CustomClassName</string>
+ <string>10.CustomClassName</string>
+ <string>10.IBEditorWindowLastContentRect</string>
+ <string>10.IBPluginDependency</string>
+ <string>2.IBAttributePlaceholdersKey</string>
+ <string>2.IBEditorWindowLastContentRect</string>
+ <string>2.IBPluginDependency</string>
+ <string>3.CustomClassName</string>
+ <string>3.IBPluginDependency</string>
+ </object>
+ <object class="NSMutableArray" key="dict.values">
+ <bool key="EncodedWithXMLCoder">YES</bool>
+ <string>UIApplication</string>
+ <string>UIResponder</string>
+ <string>minimal_iosViewController</string>
+ <string>{{415, 586}, {320, 480}}</string>
+ <string>com.apple.InterfaceBuilder.IBCocoaTouchPlugin</string>
+ <object class="NSMutableDictionary">
+ <bool key="EncodedWithXMLCoder">YES</bool>
+ <reference key="dict.sortedKeys" ref="0"/>
+ <reference key="dict.values" ref="0"/>
+ </object>
+ <string>{{228, 376}, {320, 480}}</string>
+ <string>com.apple.InterfaceBuilder.IBCocoaTouchPlugin</string>
+ <string>minimal_iosAppDelegate</string>
+ <string>com.apple.InterfaceBuilder.IBCocoaTouchPlugin</string>
+ </object>
+ </object>
+ <object class="NSMutableDictionary" key="unlocalizedProperties">
+ <bool key="EncodedWithXMLCoder">YES</bool>
+ <reference key="dict.sortedKeys" ref="0"/>
+ <reference key="dict.values" ref="0"/>
+ </object>
+ <nil key="activeLocalization"/>
+ <object class="NSMutableDictionary" key="localizations">
+ <bool key="EncodedWithXMLCoder">YES</bool>
+ <reference key="dict.sortedKeys" ref="0"/>
+ <reference key="dict.values" ref="0"/>
+ </object>
+ <nil key="sourceID"/>
+ <int key="maxID">11</int>
+ </object>
+ <object class="IBClassDescriber" key="IBDocument.Classes"/>
+ <int key="IBDocument.localizationMode">0</int>
+ <string key="IBDocument.TargetRuntimeIdentifier">IBCocoaTouchFramework</string>
+ <object class="NSMutableDictionary" key="IBDocument.PluginDeclaredDevelopmentDependencies">
+ <string key="NS.key.0">com.apple.InterfaceBuilder.CocoaTouchPlugin.InterfaceBuilder3</string>
+ <integer value="3100" key="NS.object.0"/>
+ </object>
+ <bool key="IBDocument.PluginDeclaredDependenciesTrackSystemTargetVersion">YES</bool>
+ <string key="IBDocument.LastKnownRelativeProjectPath">OpenGLES_iPhone.xcodeproj</string>
+ <int key="IBDocument.defaultPropertyAccessControl">3</int>
+ <string key="IBCocoaTouchPluginVersion">106</string>
+ </data>
+</archive>
View
145 examples/dreamtorus/ios/minimal_ios/en.lproj/minimal_iosViewController.xib
@@ -0,0 +1,145 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<archive type="com.apple.InterfaceBuilder3.CocoaTouch.XIB" version="7.10">
+ <data>
+ <int key="IBDocument.SystemTarget">1024</int>
+ <string key="IBDocument.SystemVersion">10H574</string>
+ <string key="IBDocument.InterfaceBuilderVersion">1248</string>
+ <string key="IBDocument.AppKitVersion">1038.35</string>
+ <string key="IBDocument.HIToolboxVersion">461.00</string>
+ <object class="NSMutableDictionary" key="IBDocument.PluginVersions">
+ <string key="NS.key.0">com.apple.InterfaceBuilder.IBCocoaTouchPlugin</string>
+ <string key="NS.object.0">106</string>
+ </object>
+ <object class="NSArray" key="IBDocument.IntegratedClassDependencies">
+ <bool key="EncodedWithXMLCoder">YES</bool>
+ <string>IBProxyObject</string>
+ <string>IBUIView</string>
+ </object>
+ <object class="NSArray" key="IBDocument.PluginDependencies">
+ <bool key="EncodedWithXMLCoder">YES</bool>
+ <string>com.apple.InterfaceBuilder.IBCocoaTouchPlugin</string>
+ </object>
+ <object class="NSMutableDictionary" key="IBDocument.Metadata">
+ <bool key="EncodedWithXMLCoder">YES</bool>
+ <object class="NSArray" key="dict.sortedKeys" id="0">
+ <bool key="EncodedWithXMLCoder">YES</bool>
+ </object>
+ <reference key="dict.values" ref="0"/>
+ </object>
+ <object class="NSMutableArray" key="IBDocument.RootObjects" id="1000">
+ <bool key="EncodedWithXMLCoder">YES</bool>
+ <object class="IBProxyObject" id="841351856">
+ <string key="IBProxiedObjectIdentifier">IBFilesOwner</string>
+ <string key="targetRuntimeIdentifier">IBCocoaTouchFramework</string>
+ </object>
+ <object class="IBProxyObject" id="371349661">
+ <string key="IBProxiedObjectIdentifier">IBFirstResponder</string>
+ <string key="targetRuntimeIdentifier">IBCocoaTouchFramework</string>
+ </object>
+ <object class="IBUIView" id="184854543">
+ <reference key="NSNextResponder"/>
+ <int key="NSvFlags">274</int>
+ <string key="NSFrameSize">{320, 460}</string>
+ <reference key="NSSuperview"/>
+ <reference key="NSWindow"/>
+ <reference key="NSNextKeyView"/>
+ <object class="NSColor" key="IBUIBackgroundColor">
+ <int key="NSColorSpace">3</int>
+ <bytes key="NSWhite">MQA</bytes>
+ <object class="NSColorSpace" key="NSCustomColorSpace">
+ <int key="NSID">2</int>
+ </object>
+ </object>
+ <bool key="IBUIClearsContextBeforeDrawing">NO</bool>
+ <string key="targetRuntimeIdentifier">IBCocoaTouchFramework</string>
+ </object>
+ </object>
+ <object class="IBObjectContainer" key="IBDocument.Objects">
+ <object class="NSMutableArray" key="connectionRecords">
+ <bool key="EncodedWithXMLCoder">YES</bool>
+ <object class="IBConnectionRecord">
+ <object class="IBCocoaTouchOutletConnection" key="connection">
+ <string key="label">view</string>
+ <reference key="source" ref="841351856"/>
+ <reference key="destination" ref="184854543"/>
+ </object>
+ <int key="connectionID">3</int>
+ </object>
+ </object>
+ <object class="IBMutableOrderedSet" key="objectRecords">
+ <object class="NSArray" key="orderedObjects">
+ <bool key="EncodedWithXMLCoder">YES</bool>
+ <object class="IBObjectRecord">
+ <int key="objectID">0</int>
+ <reference key="object" ref="0"/>
+ <reference key="children" ref="1000"/>
+ <nil key="parent"/>
+ </object>
+ <object class="IBObjectRecord">
+ <int key="objectID">-1</int>
+ <reference key="object" ref="841351856"/>
+ <reference key="parent" ref="0"/>
+ <string key="objectName">File's Owner</string>
+ </object>
+ <object class="IBObjectRecord">
+ <int key="objectID">-2</int>
+ <reference key="object" ref="371349661"/>
+ <reference key="parent" ref="0"/>
+ </object>
+ <object class="IBObjectRecord">
+ <int key="objectID">2</int>
+ <reference key="object" ref="184854543"/>
+ <reference key="parent" ref="0"/>
+ </object>
+ </object>
+ </object>
+ <object class="NSMutableDictionary" key="flattenedProperties">
+ <bool key="EncodedWithXMLCoder">YES</bool>
+ <object class="NSArray" key="dict.sortedKeys">
+ <bool key="EncodedWithXMLCoder">YES</bool>
+ <string>-1.CustomClassName</string>
+ <string>-2.CustomClassName</string>
+ <string>2.CustomClassName</string>
+ <string>2.IBEditorWindowLastContentRect</string>
+ <string>2.IBPluginDependency</string>
+ </object>
+ <object class="NSMutableArray" key="dict.values">
+ <bool key="EncodedWithXMLCoder">YES</bool>
+ <string>minimal_iosViewController</string>
+ <string>UIResponder</string>
+ <string>EAGLView</string>
+ <string>{{401, 662}, {320, 460}}</string>
+ <string>com.apple.InterfaceBuilder.IBCocoaTouchPlugin</string>
+ </object>
+ </object>
+ <object class="NSMutableDictionary" key="unlocalizedProperties">
+ <bool key="EncodedWithXMLCoder">YES</bool>
+ <reference key="dict.sortedKeys" ref="0"/>
+ <reference key="dict.values" ref="0"/>
+ </object>
+ <nil key="activeLocalization"/>
+ <object class="NSMutableDictionary" key="localizations">
+ <bool key="EncodedWithXMLCoder">YES</bool>
+ <reference key="dict.sortedKeys" ref="0"/>
+ <reference key="dict.values" ref="0"/>
+ </object>
+ <nil key="sourceID"/>
+ <int key="maxID">4</int>
+ </object>
+ <object class="IBClas