Skip to main content
gamedev.net
🔒 Locked

Iso Book code conversion

Started by Dalik Feb 21, 2003 at 11:17 PM 1 replies 250+ views
Original Post
Dalik
Dalik
The tile loading class I need to change it to be able to use sdl instead of directx, has anyone done this already and there are a few things that he does that seem that sdl doesnt support. like getting the suface information I dont think sdl supports that. Anyway I just want to know if anyone can help me on this and or convert it for me and anyone else that needs it thank you.
Interested in being apart of a team of people that are developing a toolkit that can help anyone product an online game? Then click here http://tangle.thomson.id.au/
yspotua
yspotua
When in doubt, read the SDL docs. It contains information on how to get surface details. Here is brief entry from the SDL_Surface structure explanation:

SDL_Surface -- Graphical Surface Structure
Structure Definition

typedef struct SDL_Surface {
Uint32 flags; /* Read-only */
SDL_PixelFormat *format; /* Read-only */
int w, h; /* Read-only */
Uint16 pitch; /* Read-only */
void *pixels; /* Read-write */

/* clipping information */
SDL_Rect clip_rect; /* Read-only */

/* Reference count -- used when freeing surface */
int refcount; /* Read-mostly */

/* This structure also contains private fields not shown here */
} SDL_Surface;

Structure Data

flags Surface flags
format Pixel format
w, h Width and height of the surface
pitch Length of a surface scanline in bytes
pixels Pointer to the actual pixel data
clip_rect surface clip rectangle

Incidently, on Windows machines, SDL is simply a wrapper for DirectX 5. So I don''t know if you will be able do everyting that is in that book.
Dalik
Dalik
I was hoping there was a function that got the surface details, but thank you for pointing that out, this will help a lot!

Cheers
Interested in being apart of a team of people that are developing a toolkit that can help anyone product an online game? Then click here http://tangle.thomson.id.au/

Topic Locked

This topic has been locked by a moderator. New replies are not allowed.

Sign in to reply to this topic.