Real Software Forums

The forum for Real Studio and other Real Software products.
[ REAL Software Website | Board Index ]
It is currently Sun Sep 15, 2019 9:47 am
xojo

All times are UTC - 5 hours




Post new topic Reply to topic  [ 5 posts ] 
Author Message
 Post subject: A simple red book example without glut.
PostPosted: Thu Dec 10, 2009 12:44 pm 
I'm trying to get started but non of the Red book examples seem to be working for me. (And non of my old simulations work either)
I think this is because of GLUT...
From Red Book version 1.2 Chapter 1 Example 1.2, Page 18

Function Render() As Boolean
OpenGL.glClear(OpenGL.GL_COLOR_BUFFER_BIT)
OpenGL.glColor3f(1.0, 1.0, 1.0)

OpenGL.glBegin(OpenGL.GL_POLYGON)
OpenGL.glVertex3f(0.25, 0.25, 0.0)
OpenGL.glVertex3f(0.75, 0.25, 0.0)
OpenGL.glVertex3f(0.75, 0.75, 0.0)
OpenGL.glVertex3f(0.25, 0.75, 0.0)
OpenGL.glEnd()

OpenGL.glFlush()
End Function

Sub Open()
OpenGL.glClearColor(0.0, 0.0, 0.0, 0.0)
OpenGL.glMatrixMode(OpenGl.GL_PROJECTION)
OpenGL.glLoadIdentity()
OpenGL.glOrtho(0.0, 1.0, 0.0, 1.0, -1.0, 1.0)
OpenGL.glShadeModel(OpenGL.GL_FLAT)
End Sub


Top
  
Reply with quote  
 Post subject: Re: A simple red book example without glut.
PostPosted: Thu Dec 10, 2009 3:09 pm 
Offline

Joined: Fri Sep 30, 2005 8:39 pm
Posts: 364
Location: Arlington, TX
works perfectly for me, all I did was add a timer with a call to OpenGLSurface1.Render() in its action event.

Image

_________________
Open Source OpenGL Classes:
Camera (1.1), Light (1.0), Texture (1.2), Font (1.2), Mesh (1.7), Models (1.0)


Top
 Profile  
Reply with quote  
 Post subject: Re: A simple red book example without glut.
PostPosted: Thu Dec 10, 2009 3:28 pm 
Ahhh thank you!
Indeed that made all the difference...
I thought I should be able trigger the rendering without a timer.
Was I wrong?
I think i'd been spoiled by glut.


Top
  
Reply with quote  
 Post subject: Re: A simple red book example without glut.
PostPosted: Thu Dec 10, 2009 4:46 pm 
Offline

Joined: Fri Sep 30, 2005 8:39 pm
Posts: 364
Location: Arlington, TX
If you put the fire the render from open it may work, I'm not sure totally sure though. I usually use a thread to render things but a timer was easier for the situation ;)

_________________
Open Source OpenGL Classes:
Camera (1.1), Light (1.0), Texture (1.2), Font (1.2), Mesh (1.7), Models (1.0)


Top
 Profile  
Reply with quote  
 Post subject: Re: A simple red book example without glut.
PostPosted: Thu Dec 10, 2009 6:56 pm 
Offline

Joined: Fri Sep 30, 2005 12:18 pm
Posts: 629
How funny, I have the same book (3rd edition). :D


Top
 Profile  
Reply with quote  
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 5 posts ] 

All times are UTC - 5 hours


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:
Jump to:  
cron
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group