RetroBASIC
Retrogamecoding(.org) => Other Languages => Topic started by: Cybermonkey on May 31, 2013, 03:35:06 PM
-
Hi, has anyone experience with this library? I thought, I have seen a video on youtube from our member DJLinux ...
I actually succeeded in compiling it for 32 bit Linux, I'll try for 64 bit Linux at home this weekend. Of course my plans are coding a wrapper so I can use it with Freepascal. But before that I should know a few things more about the internals. Does it have it's own windowing system or does it use the Freebasic one? (If so, I'll need to program a workaround with SDL). What about texture loading? Etc.
-
Couldn't find much information about this one.
I'd love to get my hands on a very simple wrapper for opengl myself while developing a naalaa extension. I only know the really old OpenGL 1.1 stuff, which means 98% of what I know has been deprecated for ages. I'd be happy if I found a layer library that simulates the behavior of old OpenGL without using any of the deprecated functions. Because I just don't have the time doing everything from scratch. Nor am I interested in using a "game engine", because that stuff I want to do myself. In this case FreeGLUT could hopefully still be used for windowing.
-
Well, this Openb3d is somewhat compatible to the BlitzBasic3d API.
-
I can see how it'd be possible to use CD in combination with IUP to make a Linux version of NaaLaa. But as an OpenGL wrapper I don't think it'd help me much. But that's just my thought after a quick glance at CD.
-
Well, anyway, I started porting the library wrapper (a.k.a. Unit in Pascal ;)) to Freepascal. I was right with my assumption that one needs an extra windowing manager. I actually use SDL in this example but FreeGLUT might be a better alternative.
program test;
uses openb3d,crt,sdl;
var worldlight,camera,cube:pointer;
userkey:CHAR;
screen:pSDL_SURFACE;
begin
SDL_INIT(SDL_INIT_VIDEO);
SDL_GL_SETATTRIBUTE(SDL_GL_RED_SIZE, 5);
SDL_GL_SETATTRIBUTE(SDL_GL_GREEN_SIZE, 5);
SDL_GL_SETATTRIBUTE(SDL_GL_BLUE_SIZE, 5);
SDL_GL_SETATTRIBUTE(SDL_GL_DEPTH_SIZE, 16);
SDL_GL_SETATTRIBUTE(SDL_GL_DOUBLEBUFFER, 1);
screen:=SDL_SETVIDEOMODE(640, 480, 0, SDL_OPENGL);
IF screen=NIL THEN HALT;
graphics3d (640,480,0);
worldlight:=createlight();
cube :=createcube();
MoveEntity (Cube,2.5,0,5);
EntityColor (Cube,20,100,40);
camera:=createcamera();
REPEAT
SDL_DELAY(50);
UpdateWorld();
RenderWorld();
SDL_GL_SWAPBUFFERS;
UNTIL keypressed;
SDL_QUIT;
end.
See the screenshot for the result ...
-
Just finished the port of the wrapper. So far everything seems to work. I hope I can post a binary example here, soon. Meanwhile have a look at the screenshot.
-
Okay, a win32 binary. Enjoy and rotate the cube with a,s,d,q,w,e
-
Dear Mopz!! and DJLinux this thread is about OpenB3D and not OpenGL 1,2,3,... Would you be so kind, Marcus, to open a new thread for your questions?
-
Sorry :) I removed the unrelated posts and will start a new thread :)
-
I decided to go use SDL instead of GLUT. It is rather easy to open an OpenGL context with SDL and for input (keyboard, mouse etc.) I can use my existing code from the egslengine. So stay tuned, I hope I can show you something more impressive the next few days.