Ou quelle est la liste des fonctions supportées ?
Parce que j'ai voulu faire le tuto ici http://www.opengl-tutorial.org/beginners-tutorials/ avec le gadget, pour voir.
J'ai pu faire le tuto1 http://www.opengl-tutorial.org/beginner ... -a-window/ dont voici la traduction en PB5.31:
Code : Tout sélectionner
; OpenGL 2.1 Reference Pages
; https://www.opengl.org/sdk/docs/man2/
; OpenGL 3.3 Reference Pages
; https://www.opengl.org/sdk/docs/man3/
Procedure go(Gadget)
; Comme une fenêtre, un openGL gadget a besoin d'une boucle de rafraîchissement permanente.
glClear_ (#GL_COLOR_BUFFER_BIT | #GL_DEPTH_BUFFER_BIT) ; Sur certaines cartes graphiques, il est necessaire d'effacer l'écran (les buffers) avant de faire une opération de dessin.
;GL_COLOR_BUFFER_BIT: Indicates the buffers currently enabled For color writing.
;GL_DEPTH_BUFFER_BIT: Indicates the depth buffer.
;GL_STENCIL_BUFFER_BIT: Indicates the stencil buffer.
SetGadgetAttribute(Gadget, #PB_OpenGL_FlipBuffers, #True) ; Affichage à l'écran
EndProcedure
OpenWindow(0, 0, 0, 1024, 768, "OpenGL Gadget", #PB_Window_SystemMenu | #PB_Window_ScreenCentered)
OpenGLGadget(0, 0, 0, 1024, 768, #PB_OpenGL_Keyboard )
SetActiveGadget(0) ; Focus clavier sur le gadget opengl sans avoir à cliquer dessus
;SetGadgetAttribute(Gadget, #PB_OpenGL_SetContext, #True);
;// Dark blue background
glClearColor_(0.0, 0.0, 0.4, 0.0);
AddWindowTimer(0, 1, 16) ; Pour un affichage d'environ 60 fps
Repeat
Event = WaitWindowEvent()
gadget = EventGadget()
type = EventType()
Select Event
Case #PB_Event_Timer
If EventTimer() = 1
go(0) ; Boucle du gadget OpenGL
EndIf
Case #PB_Event_Gadget
Select gadget
Case 0
Select type
Case #PB_EventType_KeyUp
;Debug "ok"
touche = GetGadgetAttribute(0, #PB_OpenGL_Key )
Select touche
Case #PB_Shortcut_Escape
End
EndSelect
EndSelect
EndSelect
EndSelect
Until Event = #PB_Event_CloseWindow
; Axis explainations:
;
; +
; y
;
; |
; |
; + |
; x ---------\
; \
; \
; \
; z+
;
; So a rotate on the y axis will take the y axis as center. With OpenGL, we can specify
; positive And negative value. Positive values are always in the same sens as the axis
; (like described on the schmatic, with '+' signs)
;
M.