Qbasicnews.com

Full Version: SDLVideo BI declearation problem i think ...
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
after spending 10 minets trying to get SDL_MapRGB to work and getting error from FBC everytime i tryed to do it i decide to look over the sdlvedio.bi and compare it to SDL_video.h this was sparked by victors post saying the SLDunlock alias was wrong so i though mybe my problems where in the .bi file again so. this is what i found

extern DECLSPEC Uint32 SDLCALL SDL_MapRGB
(SDL_PixelFormat *format, Uint8 r, Uint8 g, Uint8 b);

C/C++ header decluration

declare function SDL_MapRGB cdecl alias "SDL_MapRGB" ( byref format as SDL_PixelFormat, byval r as ubyte, byval g as ubyte, byval b as ubyte ) as uinteger

See any problems ? format as SDL_Pixelformat isn't declared as a pointer.

( i haven't test this so i might be jumping the gun here and got this all screwed up. oh ya SDLMapRGBA is decleared the same way)
ByRef takes care of the pointer business... it passes the address of the var, rather than the value (ByVal does that)
i'm responsible for the sdl headers, as you can imagine i don't have the time to test all functions that are in there, beside it''s not finished yet approx. 80% done, 20% tested. so report everything you can find.

on that SDL_MapRGB, well the declaration seems valid to me. i'm afraid i don't have the time here but

dim pf as SDL_PixelFormat
dim r as ubyte
dim g as ubyte
dim b as ubyte
SDL_MapRGB pf, r, g, b

should work just fine. maybe the PixelFormat Structure is not finished yet, will have a look at this tomorrow.