Hi,
sorry if I am hassling but has anyone got an idea if the inline does not work for osx?
Thanks greatly
Matthew
sorry if I am hassling but has anyone got an idea if the inline does not work for osx?
Thanks greatly
Matthew
This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.
Show posts Menu
INLINE
};// namespace
extern "C" void __stdcall glLightf(int, int, float);
namespace __GLBASIC__ {
ENDINLINE
IF o.constant > 0 OR o.linear > 0 OR o.quadratic > 0
INLINE
#define GL_LIGHT0 0x4000
#define GL_CONSTANT_ATTENUATION 0x1207
#define GL_LINEAR_ATTENUATION 0x1208
#define GL_QUADRATIC_ATTENUATION 0x1209
glLightf(GL_LIGHT0+iLight, GL_CONSTANT_ATTENUATION, o.constant);
glLightf(GL_LIGHT0+iLight, GL_LINEAR_ATTENUATION, o.linear);
glLightf(GL_LIGHT0+iLight, GL_QUADRATIC_ATTENUATION, o.quadratic);
ENDINLINE
ENDIF
*** Configuration: OS-X_UNI ***
precompiling:
GPC - GLBasic Precompiler V.2008.093 - 3D, NET
Wordcount:332 commands
compile+link:
/cygdrive/c/Program Files/GLBasic/Compiler/platform/Mac/Bin/../libexec/gcc/powerpc-apple-darwin8/4.0.1/ld: multiple definitions of symbol _glAttachObjectARB
/cygdrive/C/Program Files/GLBasic/Compiler/platform/Mac/SDKs/MacOSX10.4u.sdk/System/Library/Frameworks/OpenGL.framework/Versions/A/Libraries/libGL.dylib(gll_api.o) definition of _glAttachObjectARB
/cygdrive/C/Program Files/GLBasic/Compiler/platform/Mac/OSX/Lib/libGLBasicUni.a(OpenGLRainbows.o) definition of _glAttachObjectARB in section (__DATA,__data)
/cygdrive/c/Program Files/GLBasic/Compiler/platform/Mac/Bin/../libexec/gcc/powerpc-apple-darwin8/4.0.1/ld: multiple definitions of symbol _glCompileShaderARB
/cygdrive/C/Program Files/GLBasic/Compiler/platform/Mac/SDKs/MacOSX10.4u.sdk/System/Library/Frameworks/OpenGL.framework/Versions/A/Libraries/libGL.dylib(gll_api.o) definition of _glCompileShaderARB
/cygdrive/C/Program Files/GLBasic/Compiler/platform/Mac/OSX/Lib/libGLBasicUni.a(OpenGLRainbows.o) definition of _glCompileShaderARB in section (__DATA,__data)
/cygdrive/c/Program Files/GLBasic/Compiler/platform/Mac/Bin/../libexec/gcc/powerpc-apple-darwin8/4.0.1/ld: multiple definitions of symbol _glCreateProgramObjectARB
/cygdrive/C/Program Files/GLBasic/Compiler/platform/Mac/SDKs/MacOSX10.4u.sdk/System/Library/Frameworks/OpenGL.framework/Versions/A/Libraries/libGL.dylib(gll_api.o) definition of _glCreateProgramObjectARB
/cygdrive/C/Program Files/GLBasic/Compiler/platform/Mac/OSX/Lib/libGLBasicUni.a(OpenGLRainbows.o) definition of _glCreateProgramObjectARB in section (__DATA,__data)
/cygdrive/c/Program Files/GLBasic/Compiler/platform/Mac/Bin/../libexec/gcc/powerpc-apple-darwin8/4.0.1/ld: multiple definitions of symbol _glCreateShaderObjectARB
/cygdrive/C/Program Files/GLBasic/Compiler/platform/Mac/SDKs/MacOSX10.4u.sdk/System/Library/Frameworks/OpenGL.framework/Versions/A/Libraries/libGL.dylib(gll_api.o) definition of _glCreateShaderObjectARB
/cygdrive/C/Program Files/GLBasic/Compiler/platform/Mac/OSX/Lib/libGLBasicUni.a(OpenGLRainbows.o) definition of _glCreateShaderObjectARB in section (__DATA,__data)
/cygdrive/c/Program Files/GLBasic/Compiler/platform/Mac/Bin/../libexec/gcc/powerpc-apple-darwin8/4.0.1/ld: multiple definitions of symbol _glDeleteObjectARB
/cygdrive/C/Program Files/GLBasic/Compiler/platform/Mac/SDKs/MacOSX10.4u.sdk/System/Library/Frameworks/OpenGL.framework/Versions/A/Libraries/libGL.dylib(gll_api.o) definition of _glDeleteObjectARB
/cygdrive/C/Program Files/GLBasic/Compiler/platform/Mac/OSX/Lib/libGLBasicUni.a(OpenGLRainbows.o) definition of _glDeleteObjectARB in section (__DATA,__data)
/cygdrive/c/Program Files/GLBasic/Compiler/platform/Mac/Bin/../libexec/gcc/powerpc-apple-darwin8/4.0.1/ld: multiple definitions of symbol _glGetBufferParameterivARB
/cygdrive/C/Program Files/GLBasic/Compiler/platform/Mac/SDKs/MacOSX10.4u.sdk/System/Library/Frameworks/OpenGL.framework/Versions/A/Libraries/libGL.dylib(gll_api.o) definition of _glGetBufferParameterivARB
/cygdrive/C/Program Files/GLBasic/Compiler/platform/Mac/OSX/Lib/libGLBasicUni.a(OpenGLRainbows.o) definition of _glGetBufferParameterivARB in section (__DATA,__data)
/cygdrive/c/Program Files/GLBasic/Compiler/platform/Mac/Bin/../libexec/gcc/powerpc-apple-darwin8/4.0.1/ld: multiple definitions of symbol _glGetInfoLogARB
/cygdrive/C/Program Files/GLBasic/Compiler/platform/Mac/SDKs/MacOSX10.4u.sdk/System/Library/Frameworks/OpenGL.framework/Versions/A/Libraries/libGL.dylib(gll_api.o) definition of _glGetInfoLogARB
/cygdrive/C/Program Files/GLBasic/Compiler/platform/Mac/OSX/Lib/libGLBasicUni.a(OpenGLRainbows.o) definition of _glGetInfoLogARB in section (__DATA,__data)
/cygdrive/c/Program Files/GLBasic/Compiler/platform/Mac/Bin/../libexec/gcc/powerpc-apple-darwin8/4.0.1/ld: multiple definitions of symbol _glGetObjectParameterivARB
/cygdrive/C/Program Files/GLBasic/Compiler/platform/Mac/SDKs/MacOSX10.4u.sdk/System/Library/Frameworks/OpenGL.framework/Versions/A/Libraries/libGL.dylib(gll_api.o) definition of _glGetObjectParameterivARB
/cygdrive/C/Program Files/GLBasic/Compiler/platform/Mac/OSX/Lib/libGLBasicUni.a(OpenGLRainbows.o) definition of _glGetObjectParameterivARB in section (__DATA,__data)
/cygdrive/c/Program Files/GLBasic/Compiler/platform/Mac/Bin/../libexec/gcc/powerpc-apple-darwin8/4.0.1/ld: multiple definitions of symbol _glGetUniformLocationARB
/cygdrive/C/Program Files/GLBasic/Compiler/platform/Mac/SDKs/MacOSX10.4u.sdk/System/Library/Frameworks/OpenGL.framework/Versions/A/Libraries/libGL.dylib(gll_api.o) definition of _glGetUniformLocationARB
/cygdrive/C/Program Files/GLBasic/Compiler/platform/Mac/OSX/Lib/libGLBasicUni.a(OpenGLRainbows.o) definition of _glGetUniformLocationARB in section (__DATA,__data)
/cygdrive/c/Program Files/GLBasic/Compiler/platform/Mac/Bin/../libexec/gcc/powerpc-apple-darwin8/4.0.1/ld: multiple definitions of symbol _glLinkProgramARB
/cygdrive/C/Program Files/GLBasic/Compiler/platform/Mac/SDKs/MacOSX10.4u.sdk/System/Library/Frameworks/OpenGL.framework/Versions/A/Libraries/libGL.dylib(gll_api.o) definition of _glLinkProgramARB
/cygdrive/C/Program Files/GLBasic/Compiler/platform/Mac/OSX/Lib/libGLBasicUni.a(OpenGLRainbows.o) definition of _glLinkProgramARB in section (__DATA,__data)
/cygdrive/c/Program Files/GLBasic/Compiler/platform/Mac/Bin/../libexec/gcc/powerpc-apple-darwin8/4.0.1/ld: multiple definitions of symbol _glShaderSourceARB
/cygdrive/C/Program Files/GLBasic/Compiler/platform/Mac/SDKs/MacOSX10.4u.sdk/System/Library/Frameworks/OpenGL.framework/Versions/A/Libraries/libGL.dylib(gll_api.o) definition of _glShaderSourceARB
/cygdrive/C/Program Files/GLBasic/Compiler/platform/Mac/OSX/Lib/libGLBasicUni.a(OpenGLRainbows.o) definition of _glShaderSourceARB in section (__DATA,__data)
/cygdrive/c/Program Files/GLBasic/Compiler/platform/Mac/Bin/../libexec/gcc/powerpc-apple-darwin8/4.0.1/ld: multiple definitions of symbol _glUniform1fARB
/cygdrive/C/Program Files/GLBasic/Compiler/platform/Mac/SDKs/MacOSX10.4u.sdk/System/Library/Frameworks/OpenGL.framework/Versions/A/Libraries/libGL.dylib(gll_api.o) definition of _glUniform1fARB
/cygdrive/C/Program Files/GLBasic/Compiler/platform/Mac/OSX/Lib/libGLBasicUni.a(OpenGLRainbows.o) definition of _glUniform1fARB in section (__DATA,__data)
/cygdrive/c/Program Files/GLBasic/Compiler/platform/Mac/Bin/../libexec/gcc/powerpc-apple-darwin8/4.0.1/ld: multiple definitions of symbol _glUniform1iARB
/cygdrive/C/Program Files/GLBasic/Compiler/platform/Mac/SDKs/MacOSX10.4u.sdk/System/Library/Frameworks/OpenGL.framework/Versions/A/Libraries/libGL.dylib(gll_api.o) definition of _glUniform1iARB
/cygdrive/C/Program Files/GLBasic/Compiler/platform/Mac/OSX/Lib/libGLBasicUni.a(OpenGLRainbows.o) definition of _glUniform1iARB in section (__DATA,__data)
/cygdrive/c/Program Files/GLBasic/Compiler/platform/Mac/Bin/../libexec/gcc/powerpc-apple-darwin8/4.0.1/ld: multiple definitions of symbol _glUseProgramObjectARB
/cygdrive/C/Program Files/GLBasic/Compiler/platform/Mac/SDKs/MacOSX10.4u.sdk/System/Library/Frameworks/OpenGL.framework/Versions/A/Libraries/libGL.dylib(gll_api.o) definition of _glUseProgramObjectARB
/cygdrive/C/Program Files/GLBasic/Compiler/platform/Mac/OSX/Lib/libGLBasicUni.a(OpenGLRainbows.o) definition of _glUseProgramObjectARB in section (__DATA,__data)
collect2: ld returned 1 exit status
*** FATAL ERROR - Please post this output in the forum
X_SPOT_LT iLight, o.color, o.Mg[12], o.Mg[13], o.Mg[14], _
o.Mg[12]+o.Mg[0], o.Mg[13]+o.Mg[1], o.Mg[14]+o.Mg[2], o.cutoff
// --------------------------------- //
// Project: RGB_Tute2
// Start: Thursday, February 28, 2008
// IDE Version: 5.179
//load our image
LOADSPRITE "rgb.png",1
//drawing to 2d screen
X_MAKE2D
//draw our base picture
DRAWSPRITE 1,0,0
LOCAL x=190
LOCAL y=190
LOCAL col,tx,ty,r,g,b,timer,TimeTaken
GLOBAL blue,green,red,alph
timer=GETTIMERALL()
FOR ty=0 TO y
FOR tx=0 TO x
col=GETPIXEL(tx,ty) //get the colour at tx,ty
//now split the colour into its components
r=rgbr(col)
g=rgbg(col)
b=rgbb(col)
//now use these to draw 3 images
SETPIXEL tx+200,ty,RGB(r,0,0)
SETPIXEL tx+400,ty,RGB(0,g,0)
SETPIXEL tx+600,ty,RGB(0,0,b)
//now draw another 3
SETPIXEL tx+200,ty+200,RGB(r,g,0)
SETPIXEL tx+400,ty+200,RGB(r,0,b)
SETPIXEL tx+600,ty+200,RGB(0,g,b)
//and finally another three
SETPIXEL tx+200,ty+400,RGB(r*2,g*2,b*2)
SETPIXEL tx+400,ty+400,RGB(r-tx,tx,b-tx)
SETPIXEL tx+600,ty+400,RGB(150,g/2,b/2)
NEXT
NEXT
TimeTaken=GETTIMERALL()-timer
PRINT "Time Taken = "+TimeTaken,10,550
SHOWSCREEN
KEYWAIT
END
//*************************************
//Function rgbr(col) - return the red component of a 32 bit colour
//*************************************
FUNCTION rgbr: col
red=bAND(col,0xff)
RETURN red
ENDFUNCTION
//*************************************
//Function rgbg(col) - return the green component of a 32 bit colour
//*************************************
FUNCTION rgbg: col
green=bAND(col/0x100,0xff)
RETURN green
ENDFUNCTION
//*************************************
//Function rgbb(col) - return the blue component of a 32 bit colour
//*************************************
FUNCTION rgbb: col
blue=bAND(col/0x10000,0xff)
RETURN blue
ENDFUNCTION
//*************************************
//Function rgba(col) - return the alpha component of a 32 bit colour
//*************************************
FUNCTION rgba: col
alph=bAND(col/0x1000000,0xff)
RETURN alph
ENDFUNCTION
The image I used had that transparent colour (pink) in it so the effect was a bit marred. (Is there a way to turn off the pink transparency??) You need to set the resolutuin to at least 800x600 // --------------------------------- //
// Project: lights2
// Start: Sunday, February 17, 2008
// IDE Version: 5.173
//create a plane to catch the light
MakePlane(1)
//Main loop
WHILE TRUE
X_MAKE3D 0.1,500,90
X_CAMERA 0,0,15,0,0,0
X_DRAWOBJ 1,0
SHOWSCREEN
WEND
FUNCTION MakePlane:pn
X_OBJSTART pn
X_OBJADDVERTEX -10,-10,0,0,1,RGB(128,128,128)
X_OBJADDVERTEX -10,10,0,0,0,RGB(128,128,128)
X_OBJADDVERTEX 10,10,0,1,0,RGB(128,128,128)
X_OBJADDVERTEX 10,-10,0,1,1,RGB(128,128,128)
X_OBJADDVERTEX -10,-10,0,0,1,RGB(128,128,128)
X_OBJEND
ENDFUNCTION
Now I add a spot light to the scene and you can turn it on and off, change the cutoff angle and move it forwards and back along the z axis. I can't see any difference here to the first program. So what is the light doing??// --------------------------------- //
// Project: Lights
// Start: Sunday, February 17, 2008
// IDE Version: 5.173
//create a plane to catch the light
MakePlane(1)
//create a varaible to alter the cutoff
LOCAL cutoff=90
//and one to hold the z value of the light
LOCAL lightz=20
//a toggle for the light
LOCAL On=1
LIMITFPS 12
//Main loop
WHILE TRUE
X_MAKE3D 0.1,500,90
X_CAMERA 0,0,15,0,0,0
X_DRAWOBJ 1,0
IF On =1 THEN X_SPOT_LT 0,RGB(255,255,255),0,0,lightz,0,0,-1,cutoff
IF KEY(45)=1 THEN On=ABS(On-1)
IF KEY(37)=1
cutoff=cutoff-1
IF cutoff<5 THEN cutoff=5
ENDIF
IF KEY(38)=1
cutoff=cutoff+1
IF cutoff>180 THEN cutoff=180
ENDIF
IF KEY(30)=1 THEN lightz=lightz-1
IF KEY(44)=1 THEN lightz=lightz+1
X_MAKE2D
PRINT "Use K and L to change the cutoff angle",0,10
PRINT "Use A and Z to move the light on the Z axis",0,20
PRINT "Use X to toggle the light on and off",0,30
PRINT "The light is pointing into the screen always",0,40
PRINT "On Value: "+On,0,80
PRINT "Cutoff Angle: "+cutoff,0,100
PRINT "Light at 0,0,"+lightz,0,120
SHOWSCREEN
WEND
FUNCTION MakePlane:pn
X_OBJSTART pn
X_OBJADDVERTEX -10,-10,0,0,1,RGB(128,128,128)
X_OBJADDVERTEX -10,10,0,0,0,RGB(128,128,128)
X_OBJADDVERTEX 10,10,0,1,0,RGB(128,128,128)
X_OBJADDVERTEX 10,-10,0,1,1,RGB(128,128,128)
X_OBJADDVERTEX -10,-10,0,0,1,RGB(128,128,128)
X_OBJEND
ENDFUNCTION
So my question really is - have I just missed out doing something or are the lights not working. Any help would be greatly appreciated