http://members.xoom.com/CJdeVos/index.htm
Pointers and stupidity
I thought I knew my pointer-stuff real well, but...seems like I ran into a problem I cannot solve.
I have my project set up like:
Main
- class Primitives
- class Graphics
in the class Primitives there''s an unsigned char *Dest
this Dest points to the lpSurface
and it is done like:
Primitives prim;
prim.Dest = LockSurface(Surface, &Pitch);
Now....inside the primitives class I can just call something like:
Dest[200] = 155;
and it will show on the screen after flipping.
Now.....i want to use functions out the Graphics class
so.....i make a graphics thing inside Primitives.
In the graphics-class there''s a function ShowSomething.
void RenderPicture(unsigned char *Surface, int *Pitch);
as you can guess, the Dest needs to be passed to Surface.
i did it like
RenderPicture(Dest, &Pitch);
inside this function I should be able to use:
Surface[400] = 255;
I thought this would work, and the compiler gave me no errors are whatsoever......now.....how come it doesn''t show anything on the screen? No matter what i try...NOTHING shows up
I hope you guys can help me out......
Dance with me......
This topic is closed to new replies.
Advertisement
Popular Topics
Advertisement
Recommended Tutorials
Advertisement