Autore Topic: Usare OpenGL senza evento Draw di SDL  (Letto 327 volte)

Offline vuott

  • Moderatore globale
  • Senatore Gambero
  • *****
  • Post: 11.266
  • Ne mors quidem nos iunget
    • Mostra profilo
Usare OpenGL senza evento Draw di SDL
« il: 27 Gennaio 2014, 11:04:46 »
Riporto questa discussione apparsa nella M.L. ufficiale:


" This is tangent to the thread "sdl Draw event overhead is killing frame rate".

When rendering graphics with OpenGL using SDL for window management, you define a screen like this:

Codice: gambas [Seleziona]
Public Screen As New Window As "Screen"
  With Screen
    .FullScreen = False
    .Width = 1
    .Height = 1
    .Framerate = 0
    .Show()
  End With


When Screen's .Show method is executed the Screen's Draw event procedure (Screen_Draw) begins executing continuously. As discussed in the previous thread it is extremely slow, even if practically empty and drawing nothing.

Is there a way to define a Screen/Window to be used as a render target for OpenGL that does not use SDL? I'm experimenting with gb.qt4.opengl now but am having some trouble. I've attached the project
(vedi allegato), which dies with signal 11 upon executing the line "Glu.Build2DMipmaps(TextureImage)"

I actually just created a form and then a GLArea so I think I'm on the right track, but am not sure where to go from there. I think this is how I did things years ago before moving to SDL, though without OpenGL.

-- Kevin Fishburne
"
« Chiunque, non ricorrendo lo stato di necessità, nel proprio progetto Gambas fa uso delle istruzioni Shell o Exec, è punito con la sanzione pecuniaria da euro 20,00 a euro 60,00. »

Offline vuott

  • Moderatore globale
  • Senatore Gambero
  • *****
  • Post: 11.266
  • Ne mors quidem nos iunget
    • Mostra profilo
Re: Usare OpenGL senza evento Draw di SDL
« Risposta #1 il: 28 Gennaio 2014, 08:57:53 »
...continua...


" Did you try my recent gb.sdl fix? You should get your old FPS back!

--
Benoît Minisini
"


" Hell yes. At 1024x1024 I get over 2000 FPS, and at 1x1 I get over 20000 FPS.

-- Kevin Fishburne
"
« Ultima modifica: 29 Gennaio 2014, 00:34:16 da vuott »
« Chiunque, non ricorrendo lo stato di necessità, nel proprio progetto Gambas fa uso delle istruzioni Shell o Exec, è punito con la sanzione pecuniaria da euro 20,00 a euro 60,00. »