Feature request: access to private identifier by..

BlitzMax Forums/BlitzMax Programming/Feature request: access to private identifier by..

plash(Posted 2009) [#1]
using scoping.

It would be nice to get access to some of the private functions and globals/constants in some modules.. like brl.glmax2d and brl.d3d7max2d.
I keep getting graphical glitches because some states cannot be synced between my custom OpenGL drawing and the max2d driver (specifically access to BindTex would be the best).

So, can we get a feature that allows us to use module scoping to use anything that is private in a module?

Talking about this:
brl.glmax2d.BindTex(name)
brl.dxgraphics._driver



N(Posted 2009) [#2]
Voting 'no' on this, since it introduces unnecessary ambiguity in the syntax.


plash(Posted 2009) [#3]
it introduces unnecessary ambiguity in the syntax.
You can already use module scoping to tell the compiler exactly what you want to use (just not private identifiers).


Brucey(Posted 2009) [#4]
The other option, of course, is to do away with the BRL max2d module and implement your own version... plash.glmax2d.

Copy it, rename it. Tweak the code. Job done.

I did basically the same thing for my wxGLMax2d module, because the official one imported brl.glgraphics. (Why we couldn't have a "factory"-based approach to the XXGraphics modules, like we do with pixmap/audio loaders, I don't know - would save a lot of hassles).

Anyhoo... :-)


plash(Posted 2009) [#5]
The other option, of course, is to do away with the BRL max2d module and implement your own version... plash.glmax2d.
Copy it, rename it. Tweak the code. Job done.
Is that legally out of line with the brl license?

You can't create a DLL directly exporting brl modules, so why would we be able to change the copyright (in this case to MIT) and re-release it as our own?


plash(Posted 2009) [#6]
Alternatively..

Local state_boundtex:Int

?NoTouch
	_brl_glmax2d_BindTex(..)
	state_boundtex = _brl_glmax2d_state_boundtex
	' et cetera..
?


Take a peek at the *.i files in a module's directory and the assembly code in any '.bmx' folder (the one that gets generated when you compile code), and that code should make sense.

EDIT: Where '?NoTouch .. ?' is defining an area with special privileges, different to '?<Operating System> .. ?' sections (compiling the enclosed code if the <Operating System> is the compiler's target).