after a idea of Heinz have I a lane found, on any OpenGL command access. there according to driver not zwangsläufig any extensions present are, must one itself beforehand The Speicheradresse the function give let.
In folgendem example use I two "neuere" command (OpenGL 1.3 of 2001 instead of OpenGL 1.2 of 1998 ) , circa Multitexturing, means two Textures übereinander To release.
unfortunately can not The integrierten Objects for use, and so I a die by hand create.
here an example for a conventional appeal, which with command ex ca. OpenGL 1.3 not functions:
oGL("glMultiTexCoord2f", GL_TEXTURE1&, 0.0, 0.0)
so goes it:
glMultiTexCoord2f& = oGL("wglGetProcAddress","glMultiTexCoord2f")
Call(glMultiTexCoord2f&,GL_TEXTURE1&, 0.0, 0.0)
the Profan Icon mixed with the stone Icon:
declare tex&[5], xrot!, yrot!, zrot!, cuboid&, hPic&, GL_TEXTURE0&, GL_TEXTURE1&, glActiveTexture&
GL_TEXTURE0& = 33984;
GL_TEXTURE1& = GL_TEXTURE0& + 1;
Proc Cuboid
parameters x!, y!, z!
declare glMultiTexCoord2f&
x! = x! * 0.5 : y! = y! * 0.5 : z! = z! * 0.5
ifnot cuboid&
cuboid& = ogl("StartList")
glMultiTexCoord2f& = oGL("wglGetProcAddress","glMultiTexCoord2f")
ogl("glBegin",~GL_QUADS)
' front
ogl("glNormal3f",0.0, 0.0, z!)
Call(glMultiTexCoord2f&,GL_TEXTURE1&, 0.0, 0.0) : Call(glMultiTexCoord2f&,GL_TEXTURE0&, 0.0, 0.0) : ogl("glVertex3f",-x!, -y!, z!)
Call(glMultiTexCoord2f&,GL_TEXTURE1&, 1.0, 0.0) : Call(glMultiTexCoord2f&,GL_TEXTURE0&, 1.0, 0.0) : ogl("glVertex3f",x!, -y!, z!)
Call(glMultiTexCoord2f&,GL_TEXTURE1&, 1.0, 1.0) : Call(glMultiTexCoord2f&,GL_TEXTURE0&, 1.0, 1.0) : ogl("glVertex3f",x!, y!, z!)
Call(glMultiTexCoord2f&,GL_TEXTURE1&, 0.0, 1.0) : Call(glMultiTexCoord2f&,GL_TEXTURE0&, 0.0, 1.0) : ogl("glVertex3f",-x!, y!, z!)
' Back
ogl("glNormal3f",0.0, 0.0, -z!)
Call(glMultiTexCoord2f&,GL_TEXTURE1&, 1.0, 0.0) : Call(glMultiTexCoord2f&,GL_TEXTURE0&, 1.0, 0.0) : ogl("glVertex3f",-x!, -y!, -z!)
Call(glMultiTexCoord2f&,GL_TEXTURE1&, 1.0, 1.0) : Call(glMultiTexCoord2f&,GL_TEXTURE0&, 1.0, 1.0) : ogl("glVertex3f",-x!, y!, -z!)
Call(glMultiTexCoord2f&,GL_TEXTURE1&, 0.0, 1.0) : Call(glMultiTexCoord2f&,GL_TEXTURE0&, 0.0, 1.0) : ogl("glVertex3f",x!, y!, -z!)
Call(glMultiTexCoord2f&,GL_TEXTURE1&, 0.0, 0.0) : Call(glMultiTexCoord2f&,GL_TEXTURE0&, 0.0, 0.0) : ogl("glVertex3f",x!, -y!, -z!)
' Top
ogl("glNormal3f",0.0, y!, 0.0)
Call(glMultiTexCoord2f&,GL_TEXTURE1&, 0.0, 1.0) : Call(glMultiTexCoord2f&,GL_TEXTURE0&, 0.0, 1.0) : ogl("glVertex3f",-x!, y!, -z!)
Call(glMultiTexCoord2f&,GL_TEXTURE1&, 0.0, 0.0) : Call(glMultiTexCoord2f&,GL_TEXTURE0&, 0.0, 0.0) : ogl("glVertex3f",-x!, y!, z!)
Call(glMultiTexCoord2f&,GL_TEXTURE1&, 1.0, 0.0) : Call(glMultiTexCoord2f&,GL_TEXTURE0&, 1.0, 0.0) : ogl("glVertex3f",x!, y!, z!)
Call(glMultiTexCoord2f&,GL_TEXTURE1&, 1.0, 1.0) : Call(glMultiTexCoord2f&,GL_TEXTURE0&, 1.0, 1.0) : ogl("glVertex3f",x!, y!, -z!)
' Bottom
ogl("glNormal3f",0.0, -y!, 0.0)
Call(glMultiTexCoord2f&,GL_TEXTURE1&, 1.0, 1.0) : Call(glMultiTexCoord2f&,GL_TEXTURE0&, 1.0, 1.0) : ogl("glVertex3f",-x!, -y!, -z!)
Call(glMultiTexCoord2f&,GL_TEXTURE1&, 0.0, 1.0) : Call(glMultiTexCoord2f&,GL_TEXTURE0&, 0.0, 1.0) : ogl("glVertex3f",x!, -y!, -z!)
Call(glMultiTexCoord2f&,GL_TEXTURE1&, 0.0, 0.0) : Call(glMultiTexCoord2f&,GL_TEXTURE0&, 0.0, 0.0) : ogl("glVertex3f",x!, -y!, z!)
Call(glMultiTexCoord2f&,GL_TEXTURE1&, 1.0, 0.0) : Call(glMultiTexCoord2f&,GL_TEXTURE0&, 1.0, 0.0) : ogl("glVertex3f",-x!, -y!, z!)
' Right
ogl("glNormal3f",x!, 0.0, 0.0)
Call(glMultiTexCoord2f&,GL_TEXTURE1&, 1.0, 0.0) : Call(glMultiTexCoord2f&,GL_TEXTURE0&, 1.0, 0.0) : ogl("glVertex3f",x!, -y!, -z!)
Call(glMultiTexCoord2f&,GL_TEXTURE1&, 1.0, 1.0) : Call(glMultiTexCoord2f&,GL_TEXTURE0&, 1.0, 1.0) : ogl("glVertex3f",x!, y!, -z!)
Call(glMultiTexCoord2f&,GL_TEXTURE1&, 0.0, 1.0) : Call(glMultiTexCoord2f&,GL_TEXTURE0&, 0.0, 1.0) : ogl("glVertex3f",x!, y!, z!)
Call(glMultiTexCoord2f&,GL_TEXTURE1&, 0.0, 0.0) : Call(glMultiTexCoord2f&,GL_TEXTURE0&, 0.0, 0.0) : ogl("glVertex3f",x!, -y!, z!)
' Left
ogl("glNormal3f",-x!, 0.0, 0.0)
Call(glMultiTexCoord2f&,GL_TEXTURE1&, 0.0, 0.0) : Call(glMultiTexCoord2f&,GL_TEXTURE0&, 0.0, 0.0) : ogl("glVertex3f",-x!, -y!, -z!)
Call(glMultiTexCoord2f&,GL_TEXTURE1&, 1.0, 0.0) : Call(glMultiTexCoord2f&,GL_TEXTURE0&, 1.0, 0.0) : ogl("glVertex3f",-x!, -y!, z!)
Call(glMultiTexCoord2f&,GL_TEXTURE1&, 1.0, 1.0) : Call(glMultiTexCoord2f&,GL_TEXTURE0&, 1.0, 1.0) : ogl("glVertex3f",-x!, y!, z!)
Call(glMultiTexCoord2f&,GL_TEXTURE1&, 0.0, 1.0) : Call(glMultiTexCoord2f&,GL_TEXTURE0&, 0.0, 1.0) : ogl("glVertex3f",-x!, y!, -z!)
ogl("glEnd")
ogl("EndList")
endif
ogl("DrawList", cuboid&)
Endproc
Proc DrawGLScene
oGL("Clear")
oGL("Move", 0, 0, -3)
oGL("Rotate", xrot!, yrot!, zrot!)
oGL("glEnable", ~GL_TEXTURE_2D)
Call(glActiveTexture&, GL_TEXTURE0&)
oGL("glBindTexture", ~GL_TEXTURE_2D, tex&[1])
Call(glActiveTexture&, GL_TEXTURE1&)
oGL("glBindTexture", ~GL_TEXTURE_2D, tex&[0])
Cuboid(1.0, 1.0, 1.0)
oGL("Show")
Endproc
windowtitle "Multi Texture"
CLS
oGL("Init", %hWnd, 0.7,0.7,0.7,0)
oGL("Posmode", 1)
glActiveTexture& = oGL("wglGetProcAddress","glActiveTexture")
'Texture from Icons
Mcls 32, 32 : startpaint -1 : DrawIcon "A", 0,0 : endpaint
hPic&=create("HPIC",0,"&MEMBMP")
tex&[0]=ogl("getTextureBmp",hPic&,1)
DeleteObject hPic&
'Texture from Icons
Mcls 32, 32 : startpaint -1 : DrawIcon "STEIN", 0,0 : endpaint
hPic&=create("HPIC",0,"&MEMBMP")
tex&[1]=ogl("getTextureBmp",hPic&,1)
DeleteObject hPic&
xrot! = 35
yrot! = 45
WhileNot iskey(27)
sleep 5
yrot! = yrot! + 0.1
DrawGLScene()
EndWhile
End
|