GP32 Mr Mirko Sdk:screen Functions..


nihil-00

Member
Joined
Feb 9, 2003
Messages
110
Age
38
ok, i need an explanation.

i saw on the examples that came with mr mirko's sdk some pieces of code, where you declare a pointer to the framebuffer, using as starting address the one in constant FRAMEBUFFER.
now, using an u16* type for the framebuffer assures you can access every each pixel of the framebuffer like a u16, since the framebuffer can be considered like a (320*240) elements array.

now, how comes that you can use gp_setFramebuffer with the framebbuffer pointer as an argument, while it accepts an address?
(in the examples they call gp_setFramebuffer(framebuffer), instead of gp_setFramebuffer(FRAMEBUFFER) (the first is a pointer, the second an address)).

i use this code, in c++:

Code:
u16 *framebuffer[2];
framebuffer[0] = (u16*)FRAMEBUFFER1;
framebuffer[1] = (u16*)FRAMEBUFFER2;

i use
Code:
gp_clearFramebuffer16(framebuffer[current],color);

but can't compile
Code:
gp_setFramebuffer(framebuffer[current],1);


....suggestions?


EDIT:
ok, silly question: i managed to make it work by explicitly converting the pointer to a u32 address.
 
Top