BBC BASIC
« OpenGL 3D library »

Welcome Guest. Please Login or Register.
Jan 20th, 2018, 6:03pm


Cross-platform BBC BASIC (Win32, Linux x86, Android, Mac OS-X, Raspberry Pi)

« Previous Topic | Next Topic »
Pages: 1  Notify Send Topic Print
 thread  Author  Topic: OpenGL 3D library  (Read 447 times)
Richard Russell
Administrator
ImageImageImageImageImage


member is offline

Avatar




Homepage PM


Posts: 689
xx OpenGL 3D library
« Thread started on: Oct 21st, 2016, 1:37pm »

I've succeeded in doing something which I initially doubted was possible: creating a 3D graphics library for BBCSDL (therefore using OpenGL) which presents a substantially identical interface to that presented by D3DLIB in BB4W.

Despite OpenGL and Direct3D differing in many important respects, not least that the coordinate systems are different (left-handed in one case and right-handed in the other) - and of course the detailed APIs are totally dissimilar - I've managed to cajole OpenGL into mimicking the functionality required by the library.

This makes it possible to port programs using D3DLIB from BB4W to BBCSDL (for running on Mac OS-X and Linux 86) much more straightforwardly than would otherwise have been the case, in fact it would require very little conditional code to make a program compatible with both.

The library supports textures, lighting, materials and specular reflection. Textures must be supplied as BMP files, because currently BBCSDL cannot read other image file types (to do so it would need to link with SDL_image; that may be something for the future).

I will release the library with the next version of BBCSDL.

Richard.
User IP Logged

michaelgallup
Guest
xx Re: OpenGL 3D library
« Reply #1 on: Oct 23rd, 2016, 10:57pm »

So do you plan to expand BBCSDL so it has the option of compiling stand alone programs?

Also, since you have made this much progress, would you consider experimenting further with OpenGL to make it more user friendly?
User IP Logged

Richard Russell
Administrator
ImageImageImageImageImage


member is offline

Avatar




Homepage PM


Posts: 689
xx Re: OpenGL 3D library
« Reply #2 on: Oct 24th, 2016, 08:49am »

on Oct 23rd, 2016, 10:57pm, michael wrote:
So do you plan to expand BBCSDL so it has the option of compiling stand alone programs?

The first thing to say is that 'compiling' is the responsibility of an IDE, and there are two quite separate IDEs supplied with BBCSDL: BBCEdit written by Andy Parkes and SDLIDE written by me! So in enquiring about what capabilities might be added you need to ask the question not only of me but also of Andy - and of course who's to say somebody else won't write yet another IDE? wink

A related point is that both IDEs are fairly straightforward BBC BASIC programs (in the case of SDLIDE, at least, there's not even any assembler code) so what capabilities may be provided depends not only on the original author but on what others - like yourself! - might add.

But to address your main point, what precisely do you mean by "stand alone programs" in the context of Linux and Mac-OS? The various incompatible 'flavours' of Linux rule out creating a single universal binary, so you're faced either with using some third-party installer/packager tool or relying on the end-user to install the various components he needs (as BBCSDL itself does).

In the case of Mac OS an application is distributed as a disk image file (.dmg) containing a complete hierarchy of directories and files. So whilst it's 'universal' (at least currently - who knows if and when Apple will drop support for 32-bit apps altogether) it's not a "stand alone program" in the same sense as a single .exe file in Windows.

So can you clarify what you're asking?

Quote:
Also, since you have made this much progress, would you consider experimenting further with OpenGL to make it more user friendly?

I don't really understand the question. My objective in creating the library was to make writing portable 3D programs easy, by providing a substantially identical interface to D3DLIB. So are you saying you don't find D3DLIB "user friendly", and if so what issues do you have with it?

Although it's always difficult to find the right compromise between 'simplicity' and 'functionality' (that applies equally to all the BBC BASIC libraries) I'm not unhappy with D3DLIB in that regard and I don't think anybody else has complained about it.

Richard.
« Last Edit: Oct 24th, 2016, 08:50am by Richard Russell » User IP Logged

michaelgallup
Guest
xx Re: OpenGL 3D library
« Reply #3 on: Oct 24th, 2016, 11:32am »

Quote:
So are you saying you don't find D3DLIB "user friendly", and if so what issues do you have with it?

I have no problem with it. I was interested in the direction you seemed to be heading.
If you planned to expand BBCSDL further with OPENGL abilities and you had studied it enough to adapt D3D programs, I thought you had more future work in OPENGL. That is all.

As for me, I am focusing on 2D animation tools, since Ric is working on 3D tools.



User IP Logged

Richard Russell
Administrator
ImageImageImageImageImage


member is offline

Avatar




Homepage PM


Posts: 689
xx Re: OpenGL 3D library
« Reply #4 on: Oct 24th, 2016, 12:03pm »

on Oct 24th, 2016, 11:32am, michael wrote:
I thought you had more future work in OPENGL.

The point is that "future work in OpenGL" would not be (straightforwardly) compatible with BB4W, because that does its 3D graphics primarily using Direct3D. So having gone to the trouble of improving compatibility between BB4W and BBCSDL, by writing the new library, it wouldn't make a great deal of sense to worsen it again by doing something OpenGL-specific.

In any case, I've seen very little use made of D3DLIB other than the demo programs I and David Williams have written. So I would argue that's it's premature to consider "future work" when the capabilities of the current libraries have been far from fully exploited.

Quote:
Ric is working on 3D tools.

Ric's work, whilst impressive, is largely an academic exercise because it can never compete in performance with Direct3D and OpenGL which do their calculations using the GPU.

Richard.
User IP Logged

Pages: 1  Notify Send Topic Print
« Previous Topic | Next Topic »

Donate $6.99 for 50,000 Ad-Free Pageviews!


This forum powered for FREE by Conforums ©
Sign up for your own Free Message Board today!
Terms of Service | Privacy Policy | Conforums Support | Parental Controls