   [C++/SDL]Passing a pointer to a pointer of the screen object
  I define my screen object in an engine class of mine, then I have a getter functoin to pass the pointer to other functions that need to use it. I debugged (MSVC++ .NET 2003) it and found that it was getting the proper values to initialize and all that, but when I try to pass it, nothing happens. Here's my function:inline SDL_Surface* getScreen(){ return screen; }Then I simply call it to a SDL_Surface pointer variable in another class:SDL_Surface *screen = Engine->getScreen();I get ziltch. I check the debugger, the new screen object in the other class has empty value and my program crashes. It's late and maybe I'm going crazy right now, but I think that getter function is how you pass the screen pointer object, right?   
  theres a lovely function in SDL called SDL_GetVideoSurface().it returns the current acve video surface.no messing about creating functions that do exactly the same thing!   ;Quote:Original post by rip-offtheres a lovely function in SDL called SDL_GetVideoSurface().it returns the current acve video surface.no messing about creating functions that do exactly the same thing!I agree.  Try that.However, according to the code you gave us, it should work!  Exactly how are you initializing it?  Maybe you initialized it after you get the screen?Can you maybe show us how you initialize it?  Other than that, you could just use SDL_GetVideoSurface().C++   