Author Topic: Sticky: PowerBASIC OpenGL Off-Site Community  (Read 32527 times)

0 Members and 1 Guest are viewing this topic.

Offline Jürgen Huhn

  • Jr. Member
  • **
  • Posts: 61
  • User-Rate: +9/-3
Sticky: PowerBASIC OpenGL Off-Site Community
« on: June 28, 2010, 01:28:31 PM »
To all PowerBasic OpenGL User..!

One of the Reason`s to start this Thread is that i have an increasing incomming of eMail`s
with Questions about using the OpenGL (Open Graphics Library).

To have a much better assistance under Legal Advice Scheme and to share this knowlege with the PB Community,
i will create this Thread as a Collection of good Links those giving answers to OpenGL.

The Goal of this Tread is an enlargement of the PB Community and enlargement of knowlege with the PB Community!

This Thread will be accessible also from other Sides...

First ongoing development is created also here:
http://www.powerbasic.com/support/pbforums/showthread.php?t=43874   <-- Start

All current Threads to OpenGL at powerbasic support Forum:
http://www.powerbasic.com/support/pbforums/forumdisplay.php?s=&daysprune=&f=44

PowerBasic at Google here:
http://tab.search.sweetim.com/search.asp?q=http%3A%2F%2Fwww.powerbasic.com%2Fsupport%2Fpbforums%2Fmember.php%3Fu%3D17&ln=de&src=36&lcr=0

I requesting you to give your Question in a short Form and or post an unknown Link for Reply! Also good Links without having a Question.

EG.:
-------------------------------------------------
OpenGLincluding COM objects?
-------------------------------------------------
http://www.xxx 

-------------------------------------------------
 OR  "No OpenGL doesn't including COM objects!"

if you know that..

...
.¸.•’´¯)¸.•’´¯)¸.•’´¯)¸.•’´¯)
¤ª“˜¨¨¯¯¨¨˜“ª¤....¤ ª“˜¨

Offline Patrice Terrier

  • ROMs
  • Hero Member
  • *****
  • Posts: 934
  • User-Rate: +62/-1
    • www.zapsolution.com
Re: Sticky: PowerBASIC OpenGL Off-Site Community
« Reply #1 on: June 28, 2010, 04:29:40 PM »
Jürgen

I think there have been too much thread about OpenGL lately.
Most of them focusing on basic things that have been explained for years all over the InterNET.

There is nothing new under the sun, except on this forum of course ;)

José Roca's being toward to advanced SDK programming, i will keep posting here, and nowhere else.

One thing that could be a useful project is something like my GDImage 3Dchart demo that could be turned into a full 3D business graphic, like in WinDev.

Also there are plainty of visual effects that could be added to BassBox, like the amazing magnetosphere that could be a good candidate ;D


...
 
« Last Edit: June 28, 2010, 06:01:51 PM by Patrice Terrier »
Patrice Terrier
GDImage (advanced graphic addon)
http://www.zapsolution.com

Brice Manuel

  • Guest
Re: Sticky: PowerBASIC OpenGL Off-Site Community
« Reply #2 on: June 28, 2010, 06:27:24 PM »
I am happy to see the recent interest in OpenGL on the PB forums. 

I have considered starting up a game programming forum for PB, but there really doesn't seem to be a lot of people interested in game development.  Perhaps with the recent OpenGL interest, The Times They Are a-Changin'  ;)

Offline Patrice Terrier

  • ROMs
  • Hero Member
  • *****
  • Posts: 934
  • User-Rate: +62/-1
    • www.zapsolution.com
Re: Sticky: PowerBASIC OpenGL Off-Site Community
« Reply #3 on: June 28, 2010, 06:51:49 PM »
Brice

If you have some expertise in game programming, you are welcomed to post your OpenGL code here.
There are also several peoples interrested in on the Eros's ThinBASIC web site about game programming, and most of them are also members of this forum, thus that could be the start of a new team.

...
Patrice Terrier
GDImage (advanced graphic addon)
http://www.zapsolution.com

Offline José Roca

  • Administrator
  • Hero Member
  • *****
  • Posts: 2485
  • User-Rate: +204/-0
Re: Sticky: PowerBASIC OpenGL Off-Site Community
« Reply #4 on: June 28, 2010, 07:00:21 PM »
 
Quote
José Roca's being toward to advanced SDK programming, i will keep posting here, and nowhere else.

Since DDTer's have taken power in the PB Forum, communicating with them has become too difficult. SDKer's can't use the graphic control and statements, DDT fonts, etc. Therefore, the code looks so different that a casual reader could think that has been written using a different language.

Brice Manuel

  • Guest
Re: Sticky: PowerBASIC OpenGL Off-Site Community
« Reply #5 on: June 28, 2010, 10:29:44 PM »
Patrice:  Most of my experience is actually in game development and I worked for some major (and minor) gaming companies.  However, I am not overly fond of 3D, I prefer 2D.  That said, I am actually working on a 3D related project in PB in my spare time.  Since I have reached a roadblock (mentioned in other thread) with my other 2D projects done in PB, I have a bit more spare time :-\ 

It is important for my games to work on all systems and work well under WINE on Linux (why EZSprite is so great).  As great as OpenGL is, a Windows OpenGL game will suffer under WINE.  I am working on an alternative 3D engine that purely uses software rendering.  I am trying to keep syntax close to OpenGL, yet use only native PB commands as much as possible and resort to ASM in a spot or two to improve performance.  Originally this was written in Emergence and it was using DirectDraw for rendering, but there were speed issues with EB itself.  I may be getting in over my head porting it to PB (as I am no longer using DirectDraw and that complicates things a bit), but if it works out as planned, it will allow me to finally make a 3D game I have been wanting to make for 15 years ;)


Offline Jürgen Huhn

  • Jr. Member
  • **
  • Posts: 61
  • User-Rate: +9/-3
Re: Sticky: PowerBASIC OpenGL Off-Site Community
« Reply #6 on: June 29, 2010, 01:24:37 AM »
Welcome Brice,

and wellcome to all PowerBasic, PowerBasic OpenGL User..!

Important!

(PowerBasic, PowerBasic)

Here at the Forum is the one and only Place where you will find the "FULL MODES OF OPERATIONS" Support for programming an OpenGL Context.
It`s absolute recommended and since WinVista and now Windows7 much more, to be Conform with the WinApi32.
The usage of DDT and the Headerfiles for them doesn`t provide full operation on essential Funtion`s.
The implemented PB Graphic Control, for example is limited, only RGB and BGR Pixelformat maximum
24Bit = 3 * 8 BIT = 3 Bytes per Color no Alphachannel. RGBA Pixelformat is needed to render the real OpenGL Context.

Additional also only here on the Forum the best OpenGL Third Party addon Library`s
Freeglut 2.6.0 actually translated handy glFunction`s to PB by Jose Rocca:

http://www.jose.it-berater.org/smfforum/index.php?topic=3694.msg12068#msg1206te


The last few Day`s i went through the PowerBasic Community outsite this Forum and i was really dismayed about
some Code Examples for OpemGL usage.. I will resarch the Link`s an post them here for Discussion next time.

That`s a next Reason for starting this Thread.
Normally i`m only here on the Forum to stay up to Date with my Code, Jose`s Header`s and other SDK related Topics.

Patrice and Jose, thank`s to you,
however you`re filling in the gaps with the suitable words!!
 ;)
« Last Edit: June 29, 2010, 06:52:21 AM by Jürgen Huhn »
.¸.•’´¯)¸.•’´¯)¸.•’´¯)¸.•’´¯)
¤ª“˜¨¨¯¯¨¨˜“ª¤....¤ ª“˜¨

Offline Jürgen Huhn

  • Jr. Member
  • **
  • Posts: 61
  • User-Rate: +9/-3
Re: Sticky: PowerBASIC OpenGL Off-Site Community
« Reply #7 on: June 29, 2010, 04:09:59 AM »
Jürgen

I think there have been too much thread about OpenGL lately.
Most of them focusing on basic things that have been explained for years all over the InterNET.

There is nothing new under the sun, except on this forum of course ;)


Until last week i was thinking the same, but some Day`s outside this Forum, i was involved in some Discussion`s wich have changed
this Illusion.

Especially by talking about the BASICS, our daily routine for progamming, most of the DDT user are unsuspecting
what`s behind the Hood of DDT.
Behind the Hood is that what we do!! Nothing else as plain SDK, , our daily business.

I think the Hook hides the real Interfaces (WinApi`s), because the PB DDT Style is devoloped to provide very
simple Way`s for creating Dialogs, Controls and complete Userinterfaces by using just single Statements.
The control`s and Dialog`s are completly predefined.. Also included, defined and hidden the controlprocedures for these
Windows.

We know that, but to make this old Story short, i will post here some of my last Discussions outside this Forum!!

Also Brice is comming here to learn what`s behind the Hood:
Quote
I am trying to keep syntax close to OpenGL, yet use only native PB commands as much as possible and resort to ASM in a spot or two to improve performance.

It`s needed to have this Discussion...
 ;)
...
« Last Edit: June 29, 2010, 06:49:33 AM by Jürgen Huhn »
.¸.•’´¯)¸.•’´¯)¸.•’´¯)¸.•’´¯)
¤ª“˜¨¨¯¯¨¨˜“ª¤....¤ ª“˜¨

Offline Patrice Terrier

  • ROMs
  • Hero Member
  • *****
  • Posts: 934
  • User-Rate: +62/-1
    • www.zapsolution.com
Re: Sticky: PowerBASIC OpenGL Off-Site Community
« Reply #8 on: June 29, 2010, 08:57:04 AM »
Brice,

Most of the people who have been working in the Borland's sphere (Delphi, C++ builder, etc.) have been biased with VCL, just like PB's guys using DDT.

OpenGL is the widest common denominator to be used with all languages, thus i think you should avoid using ezotics.

...
Patrice Terrier
GDImage (advanced graphic addon)
http://www.zapsolution.com

Offline Petr Schreiber

  • Full Member
  • ***
  • Posts: 183
  • User-Rate: +14/-4
Re: Sticky: PowerBASIC OpenGL Off-Site Community
« Reply #9 on: June 29, 2010, 09:16:33 AM »
Hi Brice,

Quote
As great as OpenGL is, a Windows OpenGL game will suffer under WINE

in my experience this has never been problem, if you use SDK Window in fullscreen or windowed mode.
All games in window, built on top of the TBGL module for ThinBASIC, were reported to run very good under Linux. Until I passed my Linux machine to grandpa, I did few tests on Ubuntu and there was no observable performance degradation. The PC had ancient GeForce 2 MX. If you have drivers installed (not the default ones, but directly from vendor), it runs great, the same applies to Windows.

TBGL is written in PB/Win 9 using Win32 and OpenGL 1.1+ (that means, it adapts to hardware it runs on, using more advanced features when available).

Only problem with WINE I observed was when you "hijack" some control in the window (like LABEL) as rendering surface. That works good on Windows, but never worked in WINE (it is caused by known, not solved bug in WINE).


Petr
« Last Edit: June 29, 2010, 09:19:35 AM by Petr Schreiber »
AMD Sempron 3400+ | 1GB RAM @ 533MHz | GeForce 6200 / GeForce 9500GT | 32bit Windows XP SP3

psch.thinbasic.com

Offline Patrice Terrier

  • ROMs
  • Hero Member
  • *****
  • Posts: 934
  • User-Rate: +62/-1
    • www.zapsolution.com
Re: Sticky: PowerBASIC OpenGL Off-Site Community
« Reply #10 on: June 29, 2010, 10:24:08 AM »
Petr,

Your TBGL is a great library, and an excellent example of what can be done when mastering the low level programming!

...
Patrice Terrier
GDImage (advanced graphic addon)
http://www.zapsolution.com

Chris Boss

  • Guest
Re: Sticky: PowerBASIC OpenGL Off-Site Community
« Reply #11 on: June 29, 2010, 03:29:12 PM »
One of the problems with using DDT with OpenGL is that OpenGL recommends using the CS_OWNDC class style for an OpenGL window and DDT does not provide this.

OpenGL does appear to work with DDT Dialogs though, so I am not sure whether the CS_OWNDC class style is critical or not, but it may have some downside not obvious at first.

When using DDT, I would think it better to create custom window class (custom control) so you can make sure it works perfectly with OpenGL.

I do not use DDT (pure API), so I am not limited by this.

Right now I am "fast tracking" my learning of OpenGL. I have never worked with it before, so I am trying to learn it quickly. Within a couple weeks I now have a working OpenGL custom control (hybrid actually which combines a GDI based custom Graphic control with OpenGL). The only thing the GDI part does is allow you to draw on a DIBsection buffer an image, which can then be used to draw on the background of the OpenGL window. Right now I am using glDrawPixels which is very slow on some systems, but I may convert that over to a 3D plane with a texture bitmap.

As far as the 3D objects, this is an area which requires some work since OpenGl does not directly support any 3D file format, so you have to either write your own or write code to import some standard 3D file format. What good is 3D without 3D models ?

Currently I am writing my own 3D model macro language, but I am also researching existing 3D model file formats to see if any would be good to write an import routine for.

Trying to learn OpenGL in just a couple weeks time has been a challenge.

One benefit of converting OpenGL headers to PB myself is it is a good learning experience about the syntax of OpenGL.

I have been using the spec sheets from the Opengl.org web site for all the constants and amazingly the Microsoft Windows SDK docs for the subroutine/function call syntax, since I haven't been using any commands outside the core OpenGL definition yet.

Extensions I research on opengl.org

Personally I find error trapping has been very helpful. I wrote some error trapping routines that call the OpenGL error command so I can see what errors I get after am OpenGL call.
That makes a big difference in solving problems.

I surely don't have the experience of Jose or Patrice with OpenGL, but I am fast tracking the learning experience.

The "OpenGL SuperBible" book I got has been very helpful. Amazingly I picked it up at a Goodwill store (second hand store) for just 25 cents. Best 25 cents I ever spent.

I don't though find OpenGL very intuitive though. I have to do a lot of experimenting before I appreciate what an OpenGl command is really doing.

I am finally starting to get the matrix stuff. Very important for transformations. One thing it at first which was confusing was how the matrix changes are often not absolute, but cumulative.

Also one can accomplish the same thing in more than one way in OpenGL.

I figured out how to make an object rotate on its own axis and it worked great, as an example. Turned out I was doing it the hard way with glOrtho and some calculations. Turned out when I checked some of the links on the PB forums for the NEHE examples, all I needed was glTranslate. Both worked, but one with a little less effort.

I do find the discussions on the PB forums about OpenGL valuable though. Even if it is "old hat" to some here, it does bring out interesting perspectives (and views) on OpenGL which are valuable. Just because those who post in those discussions may be "new" to OpenGL, does not mean they are "new" to programming. Gary Beenes" posts have been invaluable to me and in a short time I have been digging into OpenGl at a very fast rate. Gary writes some very clean code which is easy to read and learn from. His online tutorials have been very well written.



Offline José Roca

  • Administrator
  • Hero Member
  • *****
  • Posts: 2485
  • User-Rate: +204/-0
Re: Sticky: PowerBASIC OpenGL Off-Site Community
« Reply #12 on: June 29, 2010, 04:55:28 PM »
 
I'm neither expert in OpenGL nor in graphics programming in general. My apportation in this field has been providing headers and translating examples.

Brice Manuel

  • Guest
Re: Sticky: PowerBASIC OpenGL Off-Site Community
« Reply #13 on: June 29, 2010, 05:05:42 PM »
Quote
The last few Day`s i went through the PowerBasic Community outsite this Forum and i was really dismayed about some Code Examples for OpemGL usage.. I will resarch the Link`s an post them here for Discussion next time.

I have read the posts over on the PB forum, unfortunately I can't access the examples attached to posts.  Even though I can't participate in the discussions or try out the examples, I am glad to see the OpenGL discussions going on.  There are some good folks over there (as there are here) working on it.


Quote
OpenGL is the widest common denominator to be used with all languages, thus i think you should avoid using ezotics.

Nothing exotic.  Pretty simple actually as it is nothing more than "old school" 3D.


Quote
I did few tests on Ubuntu and there was no observable performance degradation. The PC had ancient GeForce 2 MX. If you have drivers installed (not the default ones, but directly from vendor), it runs great, the same applies to Windows.

Part of the problem with Linux is only Nvidia seems to care about releasing functional drivers.  Proper ATI and Intel drivers are severely lacking in the Linux world.

I have not looked at TB in a couple of years, but the Windows OpenGL based software I was trying out under WINE was written in Blitz Plus, so it may be Mark Sibly's OpenGL implementation that is problematic under WINE.


Quote
As far as the 3D objects, this is an area which requires some work since OpenGl does not directly support any 3D file format, so you have to either write your own or write code to import some standard 3D file format. What good is 3D without 3D models ?
3DS, MD2 and X formats are fairly easy to work with and there is a lot of documentation for them and support for them in most modeling programs.

The downside to creating your own format is you have no art pipeline and you will have to write converters to convert other formats into your format, or you will have to write exporters for some of the more common modeling programs so people can export the models they create into your format.  This is not so bad for static models, but if you are going to create an animated model format, this can get troublesome very quickly.


I wrote a simple DX based 3D engine years back for a project and it allowed for user editable levels.  I went with a custom model format (static only) and even wrote a simple model editor so EUs would not have to invest in any modeling programs which "can" be expensive.  Hmm... I should dig this out and rewrite it in PB some day.

Offline Patrice Terrier

  • ROMs
  • Hero Member
  • *****
  • Posts: 934
  • User-Rate: +62/-1
    • www.zapsolution.com
Re: Sticky: PowerBASIC OpenGL Off-Site Community
« Reply #14 on: June 29, 2010, 05:10:15 PM »
Chris,

From the people coming here:
Some use this forum as a super-market, grabing the code without even a "merci".
Some are always asking, without giving anything in return.
Some are sharing their tips and source codes with others.

Sometimes this takes over me, and then i am getting rough.
Ask yourself what a low level SDK programmer could learn from DDT contributors or proprietary code.

...

Patrice Terrier
GDImage (advanced graphic addon)
http://www.zapsolution.com