Raydium 3D Game Engine

Official forum for everything about Raydium, ManiaDrive, MeMak, ...
It is currently Fri Sep 18, 2020 8:35 pm

All times are UTC

Post new topic Reply to topic  [ 2 posts ] 
Author Message
 Post subject: About API Reference
PostPosted: Sat Oct 03, 2009 11:21 pm 

Joined: Thu Oct 09, 2008 5:49 pm
Posts: 69
Firstly, I would like to say that the API reference on the wiki has helped me tons and that I really like it!

I only know little C++, and knew no C (though they are kinda the same) but I was able to learn a lot of Radium very quickly!

I do have question though, for more experienced (or maybe just plain experienced :D) programmer with Raydium...

Is there somewhere that has tutorial for Gui, possibly?
I searched in Google lots, and found info about RayPHP (which maybe can display a PHP/HTML based gui?)
But... with lack of better words.. I am very new to this :D

I suppose I need a bit of explaining, like for instance, on the API reference...

Raydium's GUI are themable, using ".gui" theme text files. A default "full"
theme is provided as "theme-raydium2.gui" (and suitable ".tga" file) on the
data repository.

What does a .gui file actually do, if you have API and must code Gui in C..?
Does it like change font color and text size? or something else?

The idea is simple: build a window (position and size), and create
widgets over this window.
All widgets are created using the current sizes (x,y and font). See
suitable function).

This does make sense. For instance (what I am thinking?) is that you make a 'clear' window over the actual map (say I have like hills.tri loaded) and then in that 'clear' window, you could display buttons, then put a texture on each button?

Do you get to specify texture for each button?

Like for instance..

I have window that is 500x500 (just example)
and I make a gui that was 500x500
then I make 4 buttons that are 50x50 each
could I put a 50x50 texture in each button?
or must I make a 500x500 texture for the whole gui? that has my 50x50 button textures on it?

Sorry for all questions...

Also, (I know I know, I must be very bugging to you all) could someone give a small example, with comments of what each piece of code do?
for instance, say I have this test application (just for reference, really.)

#include "raydium/index.c"
GLfloat sun[]={1.0,0.9,0.5,1.0};
GLfloat camx=10;
GLfloat camy=10;
GLfloat camz=20;
void display(void)
if(raydium_key[GLUT_KEY_PAGE_DOWN]) camz--;
if(raydium_key[GLUT_KEY_PAGE_UP]  ) camz++;
if(raydium_key_last==1027) exit(0);
int main(int argc, char **argv)
raydium_window_create(640,480,RAYDIUM_RENDERING_WINDOW,"Mon premier test !");
return 0;

how would I go about adding a simplistic gui that just had a start, and exit button, with a texture (or no texture) on it?
Could someone example code for me?

Sorry about all the hassle I must cause :lol:

 Post subject: Re: About API Reference
PostPosted: Mon Oct 05, 2009 8:37 pm 
User avatar

Joined: Sun Mar 16, 2003 2:53 am
Posts: 2591
Location: gnniiiii (Scrat)

Huge bunch of questions here ! :)

To make it short, GUI system is based on "theme" files (.gui) that describes pixmaps that should be used for widgets ("buttons will used this rectangular area of the theme texture when idle, this other rectangle when activated, ..."). Then you load this .gui file into Raydium and simply ask for "high-level" widgets ("I want a windown, and a button, and it should be here on the window, ...")

The best is probably to have a look to an application that use the GUI API, like kinghill2 for a simple example, and ManiaDrive for what's probably currently the complexiest usage of this API. Source code of these applications are in the source tree of Raydium. It should help you a lot, I think.

And, yes, one day, we'll write tutorials for all this ;)

Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 2 posts ] 

All times are UTC

Who is online

Users browsing this forum: No registered users and 1 guest

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
You cannot post attachments in this forum

Search for:
Jump to:  
Powered by phpBB® Forum Software © phpBB Group