Codesnippets > Code Snippets

OpenGL calls

<< < (3/6) > >>

bigsofty:
:(


--- Code: (glbasic) ---_______________________________________
*** Configuration: WIN32 ***
precompiling:
GPC - GLBasic Precompiler V.2007.050 - 3D, NET
Wordcount:18 commands

compiling:
C:/DOCUME~1/Dad/LOCALS~1/Temp/glbasic/gpc_temp0.cpp: In function `DGInt __GLBASIC__::glbBuildTexture(DGInt, DGInt)':
C:/DOCUME~1/Dad/LOCALS~1/Temp/glbasic/gpc_temp0.cpp:221: error: expected primary-expression before "int"
C:/DOCUME~1/Dad/LOCALS~1/Temp/glbasic/gpc_temp0.cpp:221: error: `i' undeclared (first use this function)
C:/DOCUME~1/Dad/LOCALS~1/Temp/glbasic/gpc_temp0.cpp:221: error: (Each undeclared identifier is reported only once for each function it appears in.)
C:/DOCUME~1/Dad/LOCALS~1/Temp/glbasic/gpc_temp0.cpp:221: error: expected `;' before ')' token
C:/DOCUME~1/Dad/LOCALS~1/Temp/glbasic/gpc_temp0.cpp:239: error: `RETURN' undeclared (first use this function)
C:/DOCUME~1/Dad/LOCALS~1/Temp/glbasic/gpc_temp0.cpp:239: error: expected `;' before "TextureID"
*** FATAL ERROR - Please post this output in the forum
_______________________________________
*** Finished ***
Time: 0.8 sec
Build: 0 succeeded
*** 1 FAILED ***
--- End code ---
When I try and compile the top demo?

Kitty Hello:
oh dear. When copy/pasting, some IF and stuff in the inline section got spelled with capital letters. It's a bug. Better copy the file in notepad and save as .gbas. I'll fix it next release.

bigsofty:
Ah, I see. OK, not a biggie then, thank you Gernot.

bigsofty:
Just had a wee play with this... this is incredibly powerful for adding your own OpenGL features that GLBasic does not natively support...! :D

Kitty Hello:

--- Code: (glbasic) ---// --------------------------------- //
// Project: OpenGL - OpenGL calls through INLINE
// Start: Thursday, October 12, 2006
// IDE Version: 3.283


// Make a texture
FILLRECT 0,0,64,64,RGB(0x80, 0x80, 0xff)
PRINT "GLBasic", 1,1
GRABSPRITE 1, 0,0,64,32 // we use this later
GRABSPRITE 2, 0,0,64,32 // we overwrite this later
BLACKSCREEN
SHOWSCREEN

// create 3D viewport + set texture

// start OpenGL calls
WHILE TRUE
X_MAKE3D 1,10,45
X_CAMERA 0,0,5, 0,0,-1
TryGL()
SHOWSCREEN
WEND
MOUSEWAIT


// this function is required to close the MainGame function
@FUNCTION dummy:
ENDFUNCTION


// here we need an inline block _outside_ of functions, that
// gives us some prototypes for glX calls.
INLINE
} // end namespace __GLBASIC__ - see manual for INLINE

// some constants - for more see:
// http://mvb.saic.com/freeware/freewarev40/mesa/include/gl/gl.h
#define GL_QUADS 0x0007

// the functions are all >>extern "C" __stdcall

Navigation

[0] Message Index

[#] Next page

[*] Previous page

Go to full version