Question on BGL.h

Scripting in Blender with Python, and working on the API

Moderators: jesterKing, stiv

Post Reply
russose
Posts: 0
Joined: Mon Apr 19, 2004 5:01 pm

Question on BGL.h

Post by russose » Mon Oct 31, 2005 12:17 pm

Hallo,

Lot of openGL function are only "mentionned" in BGL.h. As I understand, it is an OpenGL wrapper for Python.

Do I really need the opengl function only mentionned in BGL.c to run Blender (no python script?). Or are all the functions in this wrapper also used to run Blender properly?

Thanks a lot for your answer :=)

Salvatore

stiv
Posts: 0
Joined: Tue Aug 05, 2003 7:58 am
Location: 45N 86W

Re: Question on BGL.h

Post by stiv » Mon Oct 31, 2005 2:37 pm

russose wrote: Lot of openGL function are only "mentionned" in BGL.h.
The purpose of a header ( .h ) file is to 'mention' or declare things like functions.
As I understand, it is an OpenGL wrapper for Python.
This is completely wrong. OpenGL is a system for drawing. Python is a programming language Blender uses for scripting.

Python is not necessary to run Blender.

Blender *does* have a built-in version of Python, but if you are not running Python scripts, you need not worry about it.

Blender uses OpenGL for drawing anything to the screen. You *must* have a graphics card with an OpenGL driver to run Blender.

russose
Posts: 0
Joined: Mon Apr 19, 2004 5:01 pm

Post by russose » Tue Nov 01, 2005 12:17 pm

Thanks stev for the information.

The reason for my question is that I am working on porting blender on pocketpc... pocketpc doesn't have opengl but opengl ES (a subset of opengl). But when I looked to the delta, lot of missing functions are only in this BGL.h.
With what you said, I don't need to implement all these functions to run Blender (without script in a first time...).

Thanks!
Salvatore

LetterRip
Posts: 0
Joined: Thu Mar 25, 2004 7:03 am

Post by LetterRip » Tue Nov 01, 2005 6:36 pm

For a first implementation, you could drop the python part entirely, it is used by some very useful scripts though, but you could then just implement those functions that are in common use and/or those supported by OpenGL ES.

LetterRip

ascotan
Posts: 0
Joined: Thu May 29, 2003 10:32 pm
Location: Maryland, U.S.

Post by ascotan » Tue Nov 08, 2005 6:17 pm

The BGL module stand for Blender GL and was originally written as a foundation for the old draw module I believe.

It is a wrapper for OpenGL in the sense that it allow a python script to call raw GL commands. It is not used by blender internally. However it is used by a number of scripts to draw GUIs. Our current draw module does not build on BGL I think and this module is a bit of legacy code, even though it's still pretty useful for doing low level GUI drawing.

BGL.h is used as the header file for BGL.c. You will probably not be able to get rid of the header without breaking the code in BGL.c. However, this will only affect the Blender.BGL module and will not affect blender from running normally otherwise.

russose
Posts: 0
Joined: Mon Apr 19, 2004 5:01 pm

Post by russose » Wed Nov 09, 2005 4:59 pm

I already tried a long time ago to desactivate the Python part but there were lot of dependencies and in that time, Python was really not my only :=)
If I remember good, there are really too many functions from Blender/Python in the main code... That's why I leave that inside.

Salvatore

Post Reply