IyonixMesa is a port of
Cornelissen's 3D accelerant for BeOS, and Mesa 3.2. It includes the
- Port of BeOS 2D accelerant 0.43 for nVidia graphics accelerators
- Port of BeOs 3D accelerant alpha 1f for nVidia graphics accelerators
- Port of Mesa 3.2
It allows you to build many OpenGL
programs and run them using the hardware graphics accelerator provided with
every Iyonix computer. The driver will work with the GeForce 2 MX cards supplied
with the Iyonix, and also most current PCI GeForce cards, provided a suitable
nvidia module from Castle is used. OpenGL is a standard for 3D graphics, whether hardware accelerated or not.
Many current games use OpenGL for the rendering.
In addition, functions are available for accelerating certain 2D operations,
such as rectangle copying and sprite plotting. An API for these operations will
be provided soon. Also, a module allowing 3D to be used in BASIC may be created
in the future. Also, a fixed point version of Mesa (similar to OpenGL ES) is on
It's free! I don't intend to charge for any of my RISC OS software. However,
if you'd like to make a donation, I will put the money towards buying a faster
3D accelerator (these cost from $50 to $200) and also into buying a HDTV card
with integrated MPEG decoder, so that I can make future RISC OS developments. I am also the author of
PCITV, and I have mentioned writing a
driver for hardware MPEG decoder boards before.
Download (RISC OS 5.10 only)
Due to a change in the nvidia module in RISC OS 5.10, old versions of
IyonixMesa will continue to run but will cause a hang when exited. If there is
sufficient demand, I will add a detection routine to check the version of the
operating system and run the appropriate setup function.
The following are a list of issues with IyonixMesa:
- Triangle rate is not particularly good right now due to some areas of
the graphics pipeline (such as transformation) being done in software.
- You must be sure to break out of the IyonixMesa code at a good point
(i.e. not in the middle of rendering) to avoid a crash.
- Mip-mapping must be used to draw textures in many cases, otherwise
textures can become distorted as they come close to the near clipping plane.
Using mip-maps usually speeds up the rendering of textures (the trade-off
being greater memory usage), so they should be used anyway.
- Windowing support is not currently implemented. It will be in a future
- Double-buffering currently uses an accelerated routine to copy from the
back buffer to the front. A future version will use true buffer swapping.
In no particular order, thanks to:
- Rudolf Cornelissen for kind access to his accelerant source code.
- David Boddie for his excellent
Mesa 3.4.2 for
RISC OS port, and source code.
- People on #netsurf for their testing and tips, and for being there in
the early hours.
- John Ballance for his comments and assistance.
- The other kind folks who all tested my code, and were fascinated by the
This API is subject to change once I get windowing support completed. For
now, the API provides function to initialise and close down the IyonixMesa
context, and to swap buffers.
Initialises the IyonixMesa context and associated buffers. This must be
called before any Mesa functions are called as this will set up the environment
for Mesa within RISC OS. IyonixMesa will auto-detect the current screen mode
(and will bail if anything other than 32bpp is used), but you must obtain the
width and height yourself in your program to correctly set up the viewport and
projections. IyonixMesa will run full screen in any mode you throw at it, as
long as it is 32bpp. In larger modes, the fill rate will suffer. The fill rate
is the rate at which triangles are rasterised to the back buffer.
The following steps are performed, in order:
- The IyonixMesa context is allocated
- The Mesa buffers are allocated
- A handle to an nVidia graphics card is obtained
- The locations of nVidia registers and the front buffer are determined
- The nVidia 2D and 3D acceleration engines are initialised
- Texture memory blocks are allocated
- Pointers to the nVidia device driver are set up for Mesa's use
- The viewport is set to fill the screen
Copies the back buffer to the front buffer using an accelerated BLT. In
future versions, true buffer swapping will be performed; a call to
IyonixMesaSwapBuffers() will point the screen to the location of the newly
rendered buffer, and the front buffer will become the new back buffer.
Must be called when an application has finished using Mesa. Once called, no
more Mesa functions may be called. This function frees all memory used by Mesa.
Building and Linking
IyonixMesa is supplied with pre-built 32 bit libraries which are linked with
the RISC OS standard C library (-mlibscl). Compile your OpenGL project using the
headers in the include directory (add this directory to your include path with
-I followed by the include path) and link with the libraries. There is no Mesa
module; applications are standalone.
gcc -c myApp.c -I../include -mlibscl
gcc -o !RunImage myApp.o myOtherFile.o ^.lib.libGL ^.lib.libAux ^.lib.libGlu -mlibscl
Of course, you may just need to link to libGL and not the other two. I cannot get the link command to use the standard Unix format. If anyone can improve the makefiles, please let me know!
Here's a suitable makefile (one is included in the distribution):
# Iyonix Mesa application build file
CC = gcc -c -O3 -I../include -mlibscl
LINK = gcc -o
OBJECTS = cubes.o
LIBS = ^.lib.libGL ^.lib.libAux ^.lib.libGlu
!RunImage : $(OBJECTS)
$(LINK) $@ $(OBJECTS) $(LIBS) -mlibscl
%.o : %.c
A full-screen Mesa application would normally first change to a suitable
screen mode, then initialise Mesa, then switch off the cursor and mouse pointer,
before performing rendering. Here is a skeleton application:
void getScreenDimensions(int *w, int *h);
void reshape(int w, int h);
int w, h;
/* Turn off cursors */
_kernel_swi(OS_RemoveCursors, &r, &r);
/* Set up projection matrix and viewport */
/* Render here */
void getScreenDimensions(int *w, int *h)
/* Get screen dimensions */
r.r = 1;
_kernel_swi(OS_ScreenMode, &r, &r);
mode_block = (int *)r.r;
if(mode_block != 5)
printf("Only 32bpp modes supported at the moment, sorry\n");
*w = mode_block;
*h = mode_block;
void reshape(int w, int h)
/* Set up projection matrix and viewport */
glViewport(0, 0, w, h);
gluPerspective(60, (float)w / (float)h, 1, 100);
/* First three coords are the eye's position.
* Next three are the coords of the object being looked at.
* Last three are the up vector.
gluLookAt(0.0f, 0.0f, 15.0f, 0.0f, 0.0f, 0.0f, 0.0f, 1.0f, 0.0f);