PDA

View Full Version : Member Question



peter
02-12-2013, 17:38
Hello,

I need to know, how runs it with you!
Got you a GPF ? Please report here.


#INCLUDE "a.inc"
#INCLUDE "swgl.inc"


Long hwnd
hwnd = OpenWindow 640,480,1
InitGl hwnd


Single r, v
Long i
Dim coins(6) As Long


For i=1 To 6
coins(i) = LoadImage "coins/coin" & i & ".bmp"
Next
i=1


glClearColor 0.0, 0.0, 0.96, 1.0


While KeyDown(27)=0
glClear %oGL_COLOR_BUFFER_BIT Or %oGL_DEPTH_BUFFER_BIT


glLoadIdentity
glBindTexture %oGL_TEXTURE_2D, coins(i)
glTranslatef(0.0, 0.0, 0.0)
glRotatef r, 1.0 , 1.0 , 1.0
glScalef 2.0, 2.0, 2.0
glBegin %oGL_QUADS

glTexCoord2f 1.0, 1.0: glVertex3f ( 0.2, 0.2, -0.2 )
glTexCoord2f 0.0, 1.0: glVertex3f (- 0.2, 0.2, -0.2 )
glTexCoord2f 0.0, 0.0: glVertex3f (- 0.2, 0.2, 0.2 )
glTexCoord2f 1.0, 0.0: glVertex3f ( 0.2, 0.2, 0.2 )

glTexCoord2f 1.0, 1.0: glVertex3f ( 0.2,- 0.2, 0.2 )
glTexCoord2f 0.0, 1.0: glVertex3f (- 0.2,- 0.2, 0.2 )
glTexCoord2f 0.0, 0.0: glVertex3f (- 0.2,- 0.2, -0.2 )
glTexCoord2f 1.0, 0.0: glVertex3f ( 0.2,- 0.2, -0.2 )

glTexCoord2f 1.0, 1.0: glVertex3f ( 0.2, 0.2, 0.2 )
glTexCoord2f 0.0, 1.0: glVertex3f (- 0.2, 0.2, 0.2 )
glTexCoord2f 0.0, 0.0: glVertex3f (- 0.2,- 0.2, 0.2 )
glTexCoord2f 1.0, 0.0: glVertex3f ( 0.2,- 0.2, 0.2 )

glTexCoord2f 1.0, 1.0: glVertex3f ( 0.2,- 0.2,- 0.2 )
glTexCoord2f 0.0, 1.0: glVertex3f (- 0.2,- 0.2,- 0.2 )
glTexCoord2f 0.0, 0.0: glVertex3f (- 0.2, 0.2,- 0.2 )
glTexCoord2f 1.0, 0.0: glVertex3f ( 0.2, 0.2,- 0.2 )

glTexCoord2f 1.0, 1.0: glVertex3f (- 0.2, 0.2, 0.2 )
glTexCoord2f 0.0, 1.0: glVertex3f (- 0.2, 0.2, -0.2 )
glTexCoord2f 0.0, 0.0: glVertex3f (- 0.2,- 0.2, -0.2 )
glTexCoord2f 1.0, 0.0: glVertex3f (- 0.2,- 0.2, 0.2 )

glTexCoord2f 1.0, 1.0: glVertex3f ( 0.2, 0.2,- 0.2 )
glTexCoord2f 0.0, 1.0: glVertex3f ( 0.2, 0.2, 0.2 )
glTexCoord2f 0.0, 0.0: glVertex3f ( 0.2,- 0.2, 0.2 )
glTexCoord2f 1.0, 0.0: glVertex3f ( 0.2,- 0.2,- 0.2 )
glEnd


r += 1.0
v += 0.2


If v >=1.0 Then
v = 0.0
i +=1
If i=7 Then i=1
End If


Events
SwapBuffer
SetFps 60
Wend


QuitGL
CloseWindow

mike lobanovsky
02-12-2013, 21:40
Runs OK for me. No GPF's on exit.

peter
02-12-2013, 23:40
Thank you, Mike.

peter
03-12-2013, 12:37
Hello,

two other tests.


#INCLUDE "a.inc"
#INCLUDE "swgl.inc"


Long hwnd
hwnd = OpenWindow 640,480,1
InitGl hwnd


Single x
Long texture2


texture2 = LoadImage "img/texture4.bmp"

glClearColor 0.0, 0.0, 1.0, 1.0


While KeyDown(27)=0
glClear %oGL_COLOR_BUFFER_BIT | %oGL_DEPTH_BUFFER_BIT
glLoadIdentity

glRotatef x,1.0,1.0,-1.0
glBindTexture %oGL_Texture_2D, texture2
glBegin(%oGL_QUADS)
glTexCoord2f(0.0, 0.0): glVertex3f(-0.4, -0.4, 0.4)
glTexCoord2f(1.0, 0.0): glVertex3f( 0.4, -0.4, 0.4)
glTexCoord2f(1.0, 1.0): glVertex3f( 0.4, 0.4, 0.4)
glTexCoord2f(0.0, 1.0): glVertex3f(-0.4, 0.4, 0.4)

glTexCoord2f(1.0, 0.0): glVertex3f(-0.4, -0.4, -0.4)
glTexCoord2f(1.0, 1.0): glVertex3f(-0.4, 0.4, -0.4)
glTexCoord2f(0.0, 1.0): glVertex3f( 0.4, 0.4, -0.4)
glTexCoord2f(0.0, 0.0): glVertex3f( 0.4, -0.4, -0.4)


glTexCoord2f(0.0, 1.0): glVertex3f(-0.4, 0.4, -0.4)
glTexCoord2f(0.0, 0.0): glVertex3f(-0.4, 0.4, 0.4)
glTexCoord2f(1.0, 0.0): glVertex3f( 0.4, 0.4, 0.4)
glTexCoord2f(1.0, 1.0): glVertex3f( 0.4, 0.4, -0.4)

glTexCoord2f(1.0, 1.0): glVertex3f(-0.4, -0.4, -0.4)
glTexCoord2f(0.0, 1.0): glVertex3f( 0.4, -0.4, -0.4)
glTexCoord2f(0.0, 0.0): glVertex3f( 0.4, -0.4, 0.4)
glTexCoord2f(1.0, 0.0): glVertex3f(-0.4, -0.4, 0.4)

glTexCoord2f(1.0, 0.0): glVertex3f( 0.4, -0.4, -0.4)
glTexCoord2f(1.0, 1.0): glVertex3f( 0.4, 0.4, -0.4)
glTexCoord2f(0.0, 1.0): glVertex3f( 0.4, 0.4, 0.4)
glTexCoord2f(0.0, 0.0): glVertex3f( 0.4, -0.4, 0.4)

glTexCoord2f(0.0, 0.0): glVertex3f(-0.4, -0.4, -0.4)
glTexCoord2f(1.0, 0.0): glVertex3f(-0.4, -0.4, 0.4)
glTexCoord2f(1.0, 1.0): glVertex3f(-0.4, 0.4, 0.4)
glTexCoord2f(0.0, 1.0): glVertex3f(-0.4, 0.4, -0.4)
glEnd()

x += 1.0
If x >360 Then x =-x

Events
Swapbuffer
SetFps 60
Wend


QuitGl
CloseWindow






#INCLUDE "a.inc"
OpenWindow 320,240,1
SetFont 16,16,600,""


%BLUE = &hFF0000
Long x


While KeyDown(27)=0
ClearScr %BLUE
For x=0 To 320 Step 20
FillCircle x, 0,20, Rgb 200,255,248
DrawCircle x,20,20,1,Rgb 200,255,248
Next
DrawText 80,100,"xMouse " & xMouse, Rgb 255,255,255
DrawText 80,120,"yMouse " & yMouse, Rgb 255,255,255
DrawText 80,140,"mButton " & mButton,Rgb 255,255,255
FlipBuffer
Sleep 10
Wend
CloseWindow

mike lobanovsky
03-12-2013, 13:21
Hi,

Runs smooth, exits without problems.

MouseButton() seems incomplete. Expected LMB=1, RMB=2, LMB+RMB=3, MMB/wheel button=4.