Ticket #268 (closed defect: fixed)
Opened 6 years ago
Last modified 5 years ago
SDL bad BGLView implementation
| Reported by: | michaelvoliveira | Owned by: | umccullough |
|---|---|---|---|
| Priority: | normal | Milestone: | LibPak 1.0 |
| Component: | media-libs/libsdl | Version: | 1.0 |
| Severity: | blocker | Keywords: | sdl opengl 3d gl bglview |
| Cc: | umccullough@… |
Description
Seems that our BWindow based framebuffer implementation in SDL are buggy with 3D graphics.
explaining:
After build several games and demos with SDL that uses a minimal 3d functions, appears a small black window on the left top in the screen.
Firstly I was thinking that was a problem with vesa driver. So, I dropped my Radeon HD and use haiku with onboard nvidia (rudolf nvidia driver). Same problem.
After, I search for some opengl demos, then I found good ones in
http://nehe.gamedev.net
later, building 3d examples linking only with lGL, lGLU and lglut runs fine, leading me to think that haiku opengl and bdirectwindow are ok.
So, I started to build the same examples with SDL. This is the good one
http://nehe.gamedev.net/data/lessons/lesson.asp?lesson=05
(on the bottom of this page have linux and linux SDL)
see this 3 screenshots. The first are only with opengl, the later ones with SDL.
the same problem I faced with this following games
- Neverball
- DreamChess?
- FS2
- Carworld
and many others that requires opengl and SDL to do the 3d stuff
Attachments
Change History
Changed 6 years ago by michaelvoliveira
- attachment screenshot1.png added
comment:1 Changed 6 years ago by michaelvoliveira
problem face with gcc2 and gcc4 implementations
comment:2 Changed 6 years ago by michaelvoliveira
- Type changed from task to defect
comment:3 Changed 6 years ago by michaelvoliveira
maybe is related somewhere with this?
http://dev.haiku-os.org/ticket/3191
comment:4 Changed 6 years ago by michaelvoliveira
maybe could be related with
http://ports.haiku-files.org/ticket/268 ?
comment:5 Changed 5 years ago by michaelvoliveira
Tested with aljen SoftPipe? instead Mesa Renderer:
The same results
~/Desktop/lesson05> lesson05 CALLED: SoftPipeRenderer::SoftPipeRenderer(BGLView*, ulong, BGLDispatcher*) hsp_init time: 0.000000. ColorSpace: B_RGB32 context: 1 hsp_create_layer_context time: 0.000000. BRect(l:0.0, t:0.0, r:1023.0, b:767.0) Kill Thread
comment:6 Changed 5 years ago by michaelvoliveira
- Keywords opengl gl bglview added; bwindow removed
- Summary changed from SDL bwindow problem with 3d graphics to SDL bad BGLView implementation
comment:7 Changed 5 years ago by scottmc
- Owner changed from scottmc to phoudoin
Maybe phoudoin can take a look into this?
comment:8 Changed 5 years ago by umccullough
- Cc umccullough@… added
Precisely the same issue I just ran into
comment:9 Changed 5 years ago by umccullough
- Owner changed from phoudoin to umccullough
- Status changed from new to assigned
Changed 5 years ago by umccullough
- attachment SDL-1.2-HG-2010-12-21_opengl_patch.diff added
Patch to fix OpenGL view locking problem with SDL 1.2-HG
comment:10 Changed 5 years ago by umccullough
- Resolution set to fixed
- Status changed from assigned to closed
For some reason, the UnlockGL() code had been moved around in the src/video/bwindow/SDL_BWin.h file. This caused it to hang and fail.
Additionally, I couldn't get it working with "DirectMode?" - so I disabled that in this patch for now. Perhaps someone else can investigation.
This allows testgl to work, and I was able to launch the app I was porting, but ran into other rendering issues that I'll need to investigate.
Can someone update the port and push this patch upstream for me? :)
comment:11 Changed 5 years ago by umccullough
- Resolution fixed deleted
- Status changed from closed to reopened
comment:12 Changed 5 years ago by umccullough
- Status changed from reopened to new
Sorry for noise, wasn't sure what resolution to set until the patch is pushed upstream.
comment:13 Changed 5 years ago by scottmc
i'll check and add it soon and upstream if ok. Once that happens feel free to close the Haiku ticket for testfgl fails.
comment:14 Changed 5 years ago by scottmc
- Resolution set to fixed
- Status changed from new to closed
Applied in r1263. Patch has been sent upstream.
comment:15 Changed 5 years ago by umccullough
I'm having second thoughts about the disabling of Direct Mode in that patch - I need to test on a machine that isn't using VESA. Also, maybe that part should be #ifdef'd with HAIKU so that we don't change the existing BeOS behavior (assuming this even works on BeOS any more).
comment:16 Changed 5 years ago by michaelvoliveira
umccollough !! you are my hero!!! GL mode is working now!! Thank you!!!
comment:17 Changed 5 years ago by scottmc
@michaelvoliveira, There are still some critical bugs in the current SDL port, so until those are fixed please do not go posting any new binaries of the sdl lib. See #457 where that will be tracked.
comment:18 Changed 5 years ago by michaelvoliveira
as you wish, but this bug is not happening here, after many tests
comment:19 Changed 5 years ago by scottmc
try with gcc2 and let me know if it shows up then.
comment:20 Changed 5 years ago by michaelvoliveira
Yes.. tested. works fine too! :P

opengl mode