Raydium 3D Game Engine

Official forum for everything about Raydium, ManiaDrive, MeMak, ...
It is currently Thu Mar 28, 2024 3:36 pm

All times are UTC




Post new topic Reply to topic  [ 2 posts ] 
Author Message
PostPosted: Fri Nov 22, 2013 3:33 am 
Offline

Joined: Fri Nov 22, 2013 2:56 am
Posts: 16
Hi forum :-)

I'm toying recently with Newlisp programming language. I'm trying to write a game using hardware rendered graphisc. I just found out i can use Raydium Engine inside Newlisp. I ported simple.c program into newlisp and it worked! It looks to me that Raydium has very elegant api and will match all my needs for the game. I know very little about OpenGL. I studied a few tutorials and i find it very hard to find my way around with this library. Am i right, that developing OpenGL code using OpenGL 4 hardware i could end up with code not working properly in OpenGL2 hardware? But that's not the point. I found one problem, i scrolled the source a bit and i'm aware, it could be hard to solve: raydium_init_args function is not exported to shared library. It's a problem because newlisp encourages you to create additional modules using only shared libraries. And i doubt i have knowledge to write a glue code for static linking. Luckily, the simple.c ported script runs just fine on win7 and slack14 :mrgreen: Here is my script:

Code:
(if
  (find ostype '("Win32", "Cygwin"))
  (begin
     (set 'RAYDIUM_LIB "raydium.dll"))
  (= ostype "Linux")
  (begin
    (set 'RAYDIUM_LIB "libraydium.so"))
)

(import RAYDIUM_LIB "raydium_clear_frame")
(import RAYDIUM_LIB "raydium_ode_draw_all")
(import RAYDIUM_LIB "raydium_rendering_finish")
 ;~ (import RAYDIUM_LIB "raydium_init_args")
(import RAYDIUM_LIB "raydium_init_load")
(import RAYDIUM_LIB "raydium_ode_ground_set_name")
(import RAYDIUM_LIB "raydium_callback")
(import RAYDIUM_LIB "raydium_camera_freemove")
(constant 'RAYDIUM_CAMERA_FREEMOVE_NORMAL 1)
(constant 'RAYDIUM_ODE_DRAW_NORMAL 0)

(define (display)
   (raydium_clear_frame)
   (raydium_camera_freemove RAYDIUM_CAMERA_FREEMOVE_NORMAL)
   (raydium_ode_draw_all RAYDIUM_ODE_DRAW_NORMAL)
    (raydium_rendering_finish))

(raydium_clear_frame)
(raydium_init_load "simple.conf")
(raydium_ode_ground_set_name "cocorobix.tri")
(raydium_callback (callback 0 'display))

(exit)



I hope u like my little project and i hope i will make some playable game :-)

cheers,
bitrider


Top
 Profile  
 
PostPosted: Fri Nov 22, 2013 8:37 am 
Offline
User avatar

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

Pleased to see playing around with Raydium in a particularly unusual way ! :)

About "raydium_init_args", it's supposed to be an issue only for raydium.dll, it should be fine with libraydium.so where it's exported, IIRC. In C, with win32, we solve this issue by this hack :
Code:
#define raydium_init_args(argc,argv)\
{\
atexit(raydium_atexit_call);\
raydium_init_args_hack(argc,argv);\
}

#define raydium_init_args_name(argc,argv,app_name)\
{\
atexit(raydium_atexit_call);\
raydium_init_args_name_hack(argc,argv,app_name);\
}


In other words, if you have any atexit-like functionality in Newlisp, you can "regain" raydium_init_args using raydium_atexit_call and raydium_init_args_hack, which are exported in win32 library.

Let me know if this answer is not clear enough :)

About OpenGL version, vendor drivers always provides retro-compliant APIs (not always true with OpenGL ES on embedded devices, of course), so it means that your OpenGL 4 compliant driver+card will also provides all OpenGL features of OpenGL 3.3, 3.2, and so on down to OpenGL 1.0.

If you want to create OpenGL 2 code, you must watch out and only use OpenGL 2 functions (and avoid 1.x, for this particular case). Note that you can set explicitly your GLSL version in your shaders, it's an easy way to keep them compliant with a particular OpenGL version (GLSL 1.20 for OpenGL 2.1)


Top
 Profile  
 
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: Google [Bot] and 32 guests


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:  
cron
Powered by phpBB® Forum Software © phpBB Group