🎉 Celebrating 25 Years of GameDev.net! 🎉

Not many can claim 25 years on the Internet! Join us in celebrating this milestone. Learn more about our history, and thank you for being a part of our community!

Pointers and stupidity

Started by
0 comments, last by CJ 24 years, 5 months ago
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......

http://members.xoom.com/CJdeVos/index.htm

Advertisement
try passing the address of the ''dest'', it could be that the function is looking at a different memory address.
this has happened to me before...ya never know.



-Syntax
-dieraxx@iname.com
-Lucas

This topic is closed to new replies.

Advertisement