From 3fa76a0019ee15564b1c6c5d3f5e194c30939b16 Mon Sep 17 00:00:00 2001 From: Ian C Date: Mon, 15 Aug 2005 01:55:15 +0000 Subject: *** empty log message *** --- glflag/.cvsignore | 3 +++ glflag/earth.png | Bin 0 -> 324058 bytes glflag/test.bmx | 51 +++++++++++++++++++++++++++++++++++++++++++++++++++ glflag/tile.png | Bin 0 -> 287 bytes 4 files changed, 54 insertions(+) create mode 100644 glflag/.cvsignore create mode 100644 glflag/earth.png create mode 100644 glflag/test.bmx create mode 100644 glflag/tile.png (limited to 'glflag') diff --git a/glflag/.cvsignore b/glflag/.cvsignore new file mode 100644 index 0000000..795866f --- /dev/null +++ b/glflag/.cvsignore @@ -0,0 +1,3 @@ +.bmx +test.exe +test.debug.exe \ No newline at end of file diff --git a/glflag/earth.png b/glflag/earth.png new file mode 100644 index 0000000..6abc6fe Binary files /dev/null and b/glflag/earth.png differ diff --git a/glflag/test.bmx b/glflag/test.bmx new file mode 100644 index 0000000..24aa3ba --- /dev/null +++ b/glflag/test.bmx @@ -0,0 +1,51 @@ +' $Id$ + +Import noddybox.glflag + +Const SCRW=800 +Const SCRH=600 + +bglCreateContext(SCRW,SCRH,32,0,BGL_BACKBUFFER|BGL_DEPTHBUFFER|BGL_FULLSCREEN) +glewInit() + +tid1=bglTexFromPixmap(LoadPixmap("earth.png")) +tid2=bglTexFromPixmap(LoadPixmap("tile.png")) + +If tid1=0 Or tid2=0 + RuntimeError "Failed to open textures" +EndIf + +glClearColor(0.0, 0.0, 0.0, 1.0) +glMatrixMode(GL_PROJECTION) +glLoadIdentity() +gluPerspective(45.0, SCRW/SCRH, 10, 10000) + +glEnable(GL_DEPTH_TEST) +glEnable(GL_TEXTURE_2D) +glEnable(GL_CULL_FACE) +glDisable(GL_LIGHTING) + +glMatrixMode(GL_MODELVIEW) + +cells=50 +size=1 + +'f:GLFlag=GLFlag.Create(tid1,cells,cells,size,False,-200) +f:GLFlag=GLFlag.Create(tid2,cells,cells,size,True,-200) + +c=0 + +While Not KeyDown(KEY_ESCAPE) + c:+1 + + If (c=100) + f.Nudge(Rand(0,cells-1),Rand(0,cells-1),Rnd(),Rnd(),Rnd()) + c=0 + EndIf + + glClear(GL_COLOR_BUFFER_BIT|GL_DEPTH_BUFFER_BIT) + glLoadIdentity() + f.Render(0.9,0.95) + bglSwapBuffers + FlushMem +Wend diff --git a/glflag/tile.png b/glflag/tile.png new file mode 100644 index 0000000..a68eec4 Binary files /dev/null and b/glflag/tile.png differ -- cgit v1.2.3