Retrogamecoding(.org) > Other Languages
OpenB3D and Freebasic
Cybermonkey:
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.
Mopz:
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.
Cybermonkey:
Well, this Openb3d is somewhat compatible to the BlitzBasic3d API.
Mopz:
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.
Cybermonkey:
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.
--- Code: ---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.
--- End code ---
See the screenshot for the result ...
Navigation
[0] Message Index
[#] Next page
Go to full version