SDL OpenGL Demos for Euphoria

February 5, 2003

Mark K. Akita - mkakita@earthlink.net

 

 

Hello Again!

 

This is a series of example programs showing how to use OpenGL with SDL that were converted from C to Euphoria.  The programs here make use of SDL_Wrap and version 030130 of EuGL, Mic’s remarkable OpenGL interface.  Essentially these files allow the Euphoria programming language to utilize all the incredibly cool 3D graphics functions in OpenGL.  Why use OpenGL on top of SDL?  SDL provides additional functions for audio, timing, and input that can be combined with OpenGL graphics, in short everything else you might need to create a game or other application.  This set of conversions includes the first 8 out of 29 examples, so (time permitting) I’ll convert some more.  

 

SDL was written by Sam Lantinga and is distributed under the GNU Lesser Public License. 

For more information about SDL visit the official website http://www.libsdl.org

EuGL is by Mic 2002/2003

 

 

What you need to get started…

 

The following files are included with this SDL_mixer wrapper package:

README.TXT – this file in plain text form

README.HTML – this file in HTML form

SDL.DLL – The SDL dynamic link library

SDL_WRAP.EW – The Euphoria wrapper include file for SDL

GL_ASC.E, EUGL.EW, GL. EW, GLAUX.EW, GLU.EW , EWIN32API.EW– The EuGL files

LESSON2.EXW thru LESSON9.EXW – The demo programs

BITMAPS – a folder containing images used by the demo programs

 

 

A quick guide to the example programs

 

For all of the demo programs, press the Esc key or click the mouse anywhere on the demo screen to exit.

 

Lesson02 – Display a white triangle and white square on a black background.

 

Lesson03 – Display a triangle with colored vertexes and a blue square on a black background.

 

Lesson04 – Display a spinning triangle and square.

 

Lesson05 – Display a spinning tetrahedron and cube.

 

Lesson06 – Display a spinning textured cube on a blue background.

 

Lesson07 – Display a textured cube on a blue background.  Press the arrow keys to increase/decrease rotation along the x/y axis.  Press the Page Up/Down keys to bring the cube closer/further.  Press the L key to toggle lighting off/on.  Press the F key to toggle the texture mapping type  

 

Lesson08 – Display a textured cube on a black background.  Press the arrow keys to increase/decrease rotation along the x/y axis.  Press the Page Up/Down keys to bring the cube closer/further.  Press the L key to toggle lighting off/on.  Press the F key to toggle the texture mapping type.  Press B to toggle blending (transparency).

 

Lesson09 – Display a circle of colored stars on a black background.  Press the Up/Down to change the tilt angle.  Press the Page Up/Down keys to bring the stars closer/further.  Press the T key to toggle highlights off/on.

 

 

Let me know if you like these SDL/OpenGL demos, or use them as the basis for an original program.

 

Send comments & feedback to mkakita@earthlink.net