Hello
In the examples, there is a program called cubicsphere.o2bas
i'm trying to convert this program to 64bit but can't.
i uses RTL64 , it can be compiled to exe but when run it became a blank screen
if i uses RTL32 the cubic sphere is shown
$ title "Cubic sphere"
$ FileName "Cubicsphere.exe"
uses RTL64
% ExplicitMain
% MultiSamples 4 '0..4..16
include "OpenglSceneFrame.inc"
uses glo2\shapes
uses glo2\materials
uses glo2\textures
uses particles
uses MinMidi
indexbase 1
float ang1
sys cube,sphere,helix,tors,csface
sys hmo 'midi
Cloud cloud1
Smoke smoke1
Plant fern
sub InitMidi()
================
sys er
er=midiOutOpen(hmo, 0, 0, 0, CALLBACK_NULL) '0=synth a 2=soft synth
midiOutShortMsg(hmo, 0xC0+0x0D00) 'Xylophone Bells assign
end sub
function ding(sys v,n)
======================
if v>127 then v=127
if v<10 then v=10
'midiOutShortMsg(hmo, v*0x10000+n*0x100+0x89) 'percussion off
midiOutShortMsg(hmo, v*0x10000+n*0x100+0x99) 'percussion on
end function
sub initialize(sys hWnd)
========================
'
InitMidi
GDIplus 1
'
static sys p,res=256
BuildTextures 16,res
p=fern.new res,32000 'pixel map
MakeTexture p,res,res,texn[12]
fern.free
cube=CompileList : CubeForm : glEndList
sphere=CompileList : Spheric 1,1,6 : glEndList
'
SetTimer hWnd,1,10,null
end sub
sub Release(sys hwnd)
'====================
DeleteAllGlCompiled
DeleteTextures 16
Gdiplus 0
killTimer hwnd, 1
MidiOutClose hmo
end sub
sub RenderPlane(float tex,u,v)
==============================
glBindTexture GL_TEXTURE_2D,tex
glBegin GL_QUADS
glTexCoord2f 0.0,0.0 : glVertex3f -1.0,0,-1.0
glTexCoord2f u ,0.0 : glVertex3f 1.0,0,-1.0
glTexCoord2f u ,v : glVertex3f 1.0,0, 1.0
glTexCoord2f 0.0,v : glVertex3f -1.0,0, 1.0
glend
end sub
sub scene(sys hWnd)
===================
'
static single ra,ri,angi1=.4
'
ActiveFrame
glClearColor 0.5, 0.5, 0.7, 0
Fog 0.5, 0.5, 0.7, 0.020
StandardLighting li
'
sys t1=texn[10]
sys t2=texn[11]
'
'MYSTERIOUS RED PLANET
glPushMatrix
glTranslatef -20.,10.,-95.0
RedMaterial.act
glScalef 6.,6.,6.
glEnable GL_LIGHTING
glCallList sphere
'glDisable GL_LIGHTING
WhiteMaterial.act
glPopMatrix
'
'TILES
glPushMatrix
glEnable GL_TEXTURE_2D
glTranslatef -8.0,-1.99,-5.0
glScalef .25,1.,.25
glPushMatrix
sys i,j
for j=1 to 16
for i=1 to 16
RenderPlane t1,1.,1.
glTranslatef 4.,0.,0.
next
glTranslatef -62.,0.,-2.
next
glPopMatrix
glDisable GL_TEXTURE_2D
glPopMatrix
'
'GREEN PLANE
glPushMatrix
glEnable GL_TEXTURE_2D
glTranslatef 0.0,-2.0,-29.0
glScalef 16.,1.,16.
RenderPlane t2,8.,8.
glDisable GL_TEXTURE_2D
glPopMatrix
'
'SOFT SHADOWS
glEnable GL_TEXTURE_2D
glPushMatrix
glTranslatef -1.2,-1.98,-5.8 'for plinth
glScalef 2.,1.,1.5
RenderPlane texn[4],1.,1.
glPopMatrix
'
glPushMatrix
glTranslatef -3.5,-1.98,-7.5 'for cylinder
glScalef 1.,1.,1.
RenderPlane texn[3],1.,1.
glPopMatrix
'
glPushMatrix
glTranslatef 2.5,-1.98,-5.5 'for sphere
glScalef .7,.7,.7
RenderPlane texn[3],1.,1.
glPopMatrix
'glDisable GL_TEXTURE_2D
'
glPushMatrix
glTranslatef -0.,-1.98,-10. 'for metal balls
glScalef .7,.7,.7
RenderPlane texn[3],1.,1.
glPopMatrix
glDisable GL_TEXTURE_2D
'
'
'RING
GoldMaterial.act
'glEnable GL_TEXTURE_2D
'glBindTexture GL_TEXTURE_2D,texn[2]
glPushMatrix
glTranslatef 3.0,-1.6,-7.0
'glrotatef -45.,0,1,0
'glrotatef 90.0,1,0,0
glScalef .75,1.00,.75
if not tors
tors=CompileList : torus 1.,.20 : glEndList
end if
glCallList tors
glPopMatrix
glDisable GL_TEXTURE_2D
'
'METALLIC ORBS
glPushMatrix
glTranslatef 0.5,-1.5,-8.0
glScalef .25,.25,.25
SilverMaterial.act
glCallList sphere
glPopMatrix
'
glPushMatrix
glTranslatef 1.0,-1.5,-9.0
glScalef .25,.25,.25
SteelMaterial.act
glCallList sphere
glPopMatrix
'
'GLOBE
if not csface
csface=CompileList
CubicFace 8
glEndList
end if
glPushMatrix
glTranslatef -1.0,0.,-6.0
glRotatef ang1,0,1,0
'RedShinyMaterial.act
whiteMaterial.act
glEnable GL_TEXTURE_2D
glBindTexture GL_TEXTURE_2D,t2'texn(3)
glCallList csface
glRotatef 90.0,0,1,0
glCallList csface
glRotatef 90.0,0,1,0
glCallList csface
glRotatef 90.0,0,1,0
glCallList csface
glRotatef 90.0,1,0,0
glCallList csface
glRotatef 180.0,1,0,0 'top
glCallList csface
glPopMatrix
'
'BACKGROUND MOUND
glPushMatrix
glTranslatef 7.0,-9.5,-20.0
glRotatef -90.,1,0,0
glScalef 10.,10.,10.
glCallList csface
glPopMatrix
glDisable GL_TEXTURE_2D
'
'CONE
glPushMatrix
SilverMaterial.act
glTranslatef -2.0,-1.5,-6.0
glScalef .5,.5,.5
glBindTexture GL_TEXTURE_2D,t1
ConeFaces 16,0.,2.,0.
glPopMatrix
'
'CYLINDER
glPushMatrix
BronzeMaterial.act
glTranslatef -4.,-2.,-8.0
glScalef .25,.5,.25
ConeFaces 16,1.,8.,1.
glPopMatrix
'
'LIGHT SPHERE
float e[8]={1.,1.,.5,.1}
glMaterialfv GL_FRONT, GL_EMISSION, e
glPushMatrix
glTranslatef -4.0,2.5,-8.0
glScalef .5,.5,.5
SteelMaterial.act
glCallList sphere
glPopMatrix
glMaterialfv GL_FRONT, GL_EMISSION, e[5] 'emission off
'
'CYLINDER (SMOKER)
glPushMatrix
SteelMaterial.act
gltranslatef 2, -2.,-30.
glScalef .125,.5,.125
ConeFaces 16,1.,2.,1.
glPopMatrix
'
'
glEnable GL_TEXTURE_2D
WhiteMaterial.act
'
'PLINTH
glPushMatrix
glTranslatef -1.0,-1.5,-6.0
glrotatef 30.0,0,1,0
glScalef .5,.5,.5
glBindTexture GL_TEXTURE_2D,t1
glCallList cube
glPopMatrix
glDisable GL_TEXTURE_2D
glDisable GL_LIGHTING
'
'CLOUD
glEnable GL_TEXTURE_2D
glPushMatrix
gltranslatef -10.0, -10.0, -90.0
glscalef 20.0,12.0,1.0
cloud1.render 30 'max 50
glPopMatrix
glDisable GL_TEXTURE_2D
'
'SMOKE
glDisable GL_LIGHTING
glEnable GL_TEXTURE_2D
glBindTexture GL_TEXTURE_2D,texn[2]
glPushMatrix
gltranslatef 2, -.9, -30.
glScalef 2.,2.5,1.0
smoke1.r<= .45,.45,.55
smoke1.render 25 'max 50
'cloud1.render 15
glPopMatrix
glDisable GL_TEXTURE_2D
'glEnable GL_LIGHTING
'
'PLANTS
glBindTexture GL_TEXTURE_2D,texn(12)
glEnable GL_TEXTURE_2D
'
glPushMatrix
glTranslatef 1.,-1.,-3.0
glScalef .9,.9,1.
glColor4f .0,.1,.0,1.
quadtex 1,1,0
glPopMatrix
'
glPushMatrix
glTranslatef .7,-1.,-2.99
glscalef .9,.9,1.
glColor4f .0,.2,.0,1.
glRotatef 10.,0,0,1
quadtex 1.,1.,0
glPopMatrix
'
glPushMatrix
glTranslatef .5,-1.,-2.98
glscalef .9,.9,1.
glColor4f .0,.3,.0,1.
'quadtex 1.,1.,0
glPopMatrix
'
glDisable GL_TEXTURE_2D
'
ang1+=angi1
if ang1>360 then ang1-=360
sleep 10
end sub
MainWindow width,height,WS_OVERLAPPEDWINDOW