Author Topic: A Questions of libSDL  (Read 3493 times)

hilarycheng

  • Newbie
  • *
  • Posts: 41
    • View Profile
A Questions of libSDL
« on: October 14, 2004, 11:48:03 am »
I am writing Apple][ Emulator. I can run it at X11 w/o any problem. But when I run it at Zaurus with libSDL, I found that nths draw on the screen and I can't the screen anyway. the screen is keep freeze.

here is my step of using libSDL

use SDL_Init to init SDL
use SDL_SetVideoMode to setup video mode (I try both 640x480 or 640x400 for 16 bit)
get pointer from pixel buffer from SDL_Surface->pixels
when I fill the screen, I use SDL_LockSurface before touching the buffer.
I release it after I draw the screen.

What do I miss ?

-----------------
ZaurusHK

http://led.e-fever.org/zaurus/
« Last Edit: October 14, 2004, 11:54:05 am by hilarycheng »
----------------------
My Blog

http://hilary.e-fever.org

bubufr

  • Newbie
  • *
  • Posts: 1
    • View Profile
A Questions of libSDL
« Reply #1 on: October 14, 2004, 04:01:49 pm »
Hi,

I add the same issue (with libSDL 1.2.7, compiled from official sources). I found this interesting info on a SDL mailing list (http://twomix.devolution.com/pipermail/sdl/2003-January/051398.html):

---
Except for the above modifications, Qtopia port of SDL works pretty
fine and I can enjoy many games in VGA screen on SL-C700 as in the
desktop environment, although I have to allocate an image buffer as
SDL_SetVideoMode( 480, 640, 16, SDL_SWSURFACE) and rotate the VGA
(640x480) screen  CW before calling SDL_UpdateRect().
---

And actually, if I try this video mode, I have a better behaviour than with 640x480 (I can display some things on the screen, but as if it was in portrait mode, which makes it unusable)

Unfortunately, I do not quite understand what the author means by "rotate the VGA screen before calling SDL_UpdateRect()"
« Last Edit: October 14, 2004, 04:02:30 pm by bubufr »

hilarycheng

  • Newbie
  • *
  • Posts: 41
    • View Profile
A Questions of libSDL
« Reply #2 on: October 14, 2004, 09:23:53 pm »
thx for your information. Finally, I found out that I should place SDL_PollEvent when I draw into the buffer........ It believes different from x11 SDL.......
----------------------
My Blog

http://hilary.e-fever.org

guylhem

  • Hero Member
  • *****
  • Posts: 577
    • View Profile
A Questions of libSDL
« Reply #3 on: October 15, 2004, 05:17:46 pm »
Would  you know why I have 20 pixels from the extreme left side displayed on the extreme right side in portrait mode 240x320 on the sl6000 ? I would like to use 480x640 but all I get is a black screen :-/

Some coding help would be welcome.