• Create Account

### #ActualASnogarD

Posted 09 July 2012 - 10:16 AM

I wasnt but I done some more researching and googling and tried this to make a blank surface...

bool R_Surface::SetSurfaceFormat(SDL_Surface* surf_Trial) {
SDL_Surface* surf_Temp = NULL;

int width = 900;
int height = 900;
if((surf_Temp = SDL_CreateRGBSurface(SDL_SWSURFACE,width,height,32,0,0,0,0)) == NULL) {

return false;
}
if((surf_Trial = SDL_DisplayFormat(surf_Temp)) == NULL ) {
return false;
}
// Free the temp surface as we dont need it
SDL_FreeSurface(surf_Temp);
return true;
}


But while it compiles fine, it still doesnt display the image at all. I also seem to be going over my head with this little experiment... I thought it would be pretty easy, blit to one surface all the maps that may be visible to the camera, then clip a part of that surface to the screen.

The code seems to work...it isnt returning NULL ( otherwise the code would of shown me an error in my programs little 'console' ).

I am pretty sure I am not covering up the image with another.
Ahh this is frustrating...

EDIT: I did a check on the blitting operation and it is failing to blit the surface, so its not the image isnt showing...the blit has failed somewhere.

EDIT 2 : I'll try experimenting with this in a smaller code block, a simple setup to play with the feature and see what I get without the over all framework adding extra elements to the mix. Thanks for the help.... least I know it can be done...somehow.

### #2ASnogarD

Posted 09 July 2012 - 09:07 AM

I wasnt but I done some more researching and googling and tried this to make a blank surface...

bool R_Surface::SetSurfaceFormat(SDL_Surface* surf_Trial) {
SDL_Surface* surf_Temp = NULL;

int width = 900;
int height = 900;
if((surf_Temp = SDL_CreateRGBSurface(SDL_SWSURFACE,width,height,32,0,0,0,0)) == NULL) {

return false;
}
if((surf_Trial = SDL_DisplayFormat(surf_Temp)) == NULL ) {
return false;
}
// Free the temp surface as we dont need it
SDL_FreeSurface(surf_Temp);
return true;
}


But while it compiles fine, it still doesnt display the image at all. I also seem to be going over my head with this little experiment... I thought it would be pretty easy, blit to one surface all the maps that may be visible to the camera, then clip a part of that surface to the screen.

The code seems to work...it isnt returning NULL ( otherwise the code would of shown me an error in my programs little 'console' ).

I am pretty sure I am not covering up the image with another.
Ahh this is frustrating...

EDIT: I did a check on the blitting operation and it is failing to blit the surface, so its not the image isnt showing...the blit has failed somewhere.

### #1ASnogarD

Posted 09 July 2012 - 08:46 AM

I wasnt but I done some more researching and googling and tried this to make a blank surface...

bool R_Surface::SetSurfaceFormat(SDL_Surface* surf_Trial) {
SDL_Surface* surf_Temp = NULL;

int width = 900;
int height = 900;
if((surf_Temp = SDL_CreateRGBSurface(SDL_SWSURFACE,width,height,32,0,0,0,0)) == NULL) {

return false;
}
if((surf_Trial = SDL_DisplayFormat(surf_Temp)) == NULL ) {
return false;
}
// Free the temp surface as we dont need it
SDL_FreeSurface(surf_Temp);
return true;
}


But while it compiles fine, it still doesnt display the image at all. I also seem to be going over my head with this little experiment... I thought it would be pretty easy, blit to one surface all the maps that may be visible to the camera, then clip a part of that surface to the screen.

The code seems to work...it isnt returning NULL ( otherwise the code would of shown me an error in my programs little 'console' ).

I am pretty sure I am not covering up the image with another.
Ahh this is frustrating...

PARTNERS