Using Directx with SDL

Hi,

I.ve been trying to get my SDL program to use Directx as a
rendering backend with no success at all.

I use devcpp and I am running Win98. My program runs in windowed
and fullscreen modes with no problems at all. But when I try to
use directx by setting SDL_VIDEODRIVER=directx in a command
window, my program promptly crashes. What gives?

Do I need to have a special sdl.dll compiled with directx? I have
copied directx libs & includes available from sdl website to the
proper places, included directx.h in my code and successfully
compiled it. That dosen’t seem to do the trick.

SDL supposedly uses directx when its available, so what could
prevent it from doing that in my case? (I have directx 8
installed).–

regards,
Pallav.


You will be awarded some great honor.


| |
|Pallav Nawani |
|Sasken Communication Technologies Ltd. |
|Domlur, Bangalore. |
|_______________________________________________________________|

Hi,

I.ve been trying to get my SDL program to use Directx as a
rendering backend with no success at all.

I use devcpp and I am running Win98. My program runs in windowed
and fullscreen modes with no problems at all. But when I try to
use directx by setting SDL_VIDEODRIVER=directx in a command
window, my program promptly crashes. What gives?

This is usually caused by requesting hardware video surfaces and
then not locking them before accessing them. See the mailing list
archives for lots and lots of discussion about this.

See ya,
-Sam Lantinga, Software Engineer, Blizzard Entertainment

Hi,

I tried locking the HW surfaces before access, but that dosen’t
help. Program still crashes. I was using SDL_BlitSurface anyway,
so I guess locking was not the problem. I am actually trying to
get sdlmappy (on the sdl libraries page)to use directx.

I must admit I am a little confused as to how to get directx
acceleration? I searched through the archives and google, but
found nothing helpful (apart from a discussion of loosing
hardware surfaces on directx).

Any pointers to faqs etc would be appreciated (I’ve already been
through the faq’s on libsdl.org)–

regards,
Pallav.


Howe’s Law:
Everyone has a scheme that will not work.


| |
|Pallav Nawani |
|Sasken Communication Technologies Ltd. |
|Domlur, Bangalore. |
|_______________________________________________________________|

I must admit I am a little confused as to
how to get directx acceleration?

AFAIK, SDL will automatically use DirectX if it is present. If not,
it falls back to GDI. So you don’t have to do anything special at
all to get DirectX acceleration.–
Matthijs Hollemans
www.allyoursoftware.com

The problem could well be that your SDL DLL was compiled with the SDK from a
later version of DirectX than what you’re currently using…

NeilOn Thu, 23 Jan 2003 16:16:28 +0530 (IST), Pallav Nawani wrote:

Hi,

I tried locking the HW surfaces before access, but that dosen’t
help. Program still crashes. I was using SDL_BlitSurface anyway,
so I guess locking was not the problem. I am actually trying to
get sdlmappy (on the sdl libraries page)to use directx.

I must admit I am a little confused as to how to get directx
acceleration? I searched through the archives and google, but
found nothing helpful (apart from a discussion of loosing
hardware surfaces on directx).

Any pointers to faqs etc would be appreciated (I’ve already been
through the faq’s on libsdl.org)


There are only 10 kinds of people in this world; those who know binary and
those who don’t.

Neil Griffiths, neil_libsdl at thejungle.plus.com on 23/01/2003