"
How to get the PixelFormat, i try to work it out in this way:
"
static SDL_Window *screen;
…
const SDL_PixelFormat *format = screen->surface->format;
"
but the compiler complains like:
"
jni/…/jni/SDL2-2.0.1/ffplay/ffplay.c:921:51: error: dereferencing pointer
to incomplete type
"
whatever member in SDL_Window i can to access directly there’s a compile
error like above.
So my question is:
Is my above usage wrong?
If 1) true, then what’s the right way to retrieve the
SDL_Window/SDL_Surface’s PixelFomat(of SDL_PixelFormat type)?
Unlike SDL_Surface from SDL 1.2, SDL_Window uses functions to retrieve the
member info you’re used to. Here’s one of those functions: http://wiki.libsdl.org/SDL_GetWindowSize
"
How to get the PixelFormat, i try to work it out in this way:
"
static SDL_Window *screen;
…
const SDL_PixelFormat *format = screen->surface->format;
"
but the compiler complains like:
"
jni/…/jni/SDL2-2.0.1/ffplay/ffplay.c:921:51: error: dereferencing pointer
to incomplete type
"
whatever member in SDL_Window i can to access directly there’s a compile
error like above.
So my question is:
Is my above usage wrong?
If 1) true, then what’s the right way to retrieve the
SDL_Window/SDL_Surface’s PixelFomat(of SDL_PixelFormat type)?
from the wiki page and i tried to use it, but the result of it is of
Uint32, i don’t know how to convert it to a format of "SDL_PixelFormat"
type so as to hook with SDL_MapRGB(…)
Can you help me about it?
Many thanks in advance.
Best regards,
faywong
2013/10/29 Jonathan Dearborn > Unlike SDL_Surface from SDL 1.2, SDL_Window uses functions to retrieve the
"
How to get the PixelFormat, i try to work it out in this way:
"
static SDL_Window *screen;
…
const SDL_PixelFormat *format = screen->surface->format;
"
but the compiler complains like:
"
jni/…/jni/SDL2-2.0.1/ffplay/ffplay.c:921:51: error: dereferencing
pointer to incomplete type
"
whatever member in SDL_Window i can to access directly there’s a compile
error like above.
So my question is:
Is my above usage wrong?
If 1) true, then what’s the right way to retrieve the
SDL_Window/SDL_Surface’s PixelFomat(of SDL_PixelFormat type)?
from the wiki page and i tried to use it, but the result of it is of
Uint32, i don’t know how to convert it to a format of "SDL_PixelFormat"
type so as to hook with SDL_MapRGB(…)
Are you using the SDL_Renderer API or are you still using an SDL_Surface
and copying that to the screen? The new SDL_Renderer API would
use SDL_SetRenderDrawColor() and SDL_RenderFillRect() instead of
SDL_MapRGB() and SDL_FillRect().
Jonny DOn Mon, Oct 28, 2013 at 10:27 PM, fei wang wrote:
from the wiki page and i tried to use it, but the result of it is of
Uint32, i don’t know how to convert it to a format of "SDL_PixelFormat"
type so as to hook with SDL_MapRGB(…)
Can you help me about it?
Many thanks in advance.
Best regards,
faywong
2013/10/29 Jonathan Dearborn <@Jonathan_Dearborn>
Unlike SDL_Surface from SDL 1.2, SDL_Window uses functions to retrieve
the member info you’re used to. Here’s one of those functions: http://wiki.libsdl.org/SDL_GetWindowSize
"
How to get the PixelFormat, i try to work it out in this way:
"
static SDL_Window *screen;
…
const SDL_PixelFormat *format = screen->surface->format;
"
but the compiler complains like:
"
jni/…/jni/SDL2-2.0.1/ffplay/ffplay.c:921:51: error: dereferencing
pointer to incomplete type
"
whatever member in SDL_Window i can to access directly there’s a compile
error like above.
So my question is:
Is my above usage wrong?
If 1) true, then what’s the right way to retrieve the
SDL_Window/SDL_Surface’s PixelFomat(of SDL_PixelFormat type)?