Skip to content

Commit

Permalink
[ps3] use render flag SDL_RENDERER_SOFTWARE
Browse files Browse the repository at this point in the history
  • Loading branch information
humbertodias committed Mar 4, 2024
1 parent 81618a2 commit cfb670a
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 2 deletions.
2 changes: 1 addition & 1 deletion misc/ps3/sdl2-example.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ int main(int argc, char *argv[])
0
);

SDL_Renderer * renderer = SDL_CreateRenderer(window, -1, SDL_RENDERER_ACCELERATED);
SDL_Renderer * renderer = SDL_CreateRenderer(window, -1, SDL_RENDERER_SOFTWARE);

SDL_Rect square = {216, 96, 34, 64};

Expand Down
11 changes: 10 additions & 1 deletion src/r-tech1/graphics/sdl2/bitmap.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -994,7 +994,16 @@ int Graphics::setGraphicsMode(int mode, int width, int height){
return 1;
}

SDL_Renderer* renderer = SDL_CreateRenderer(window, -1, SDL_RENDERER_ACCELERATED);
// Define default renderer flags
Uint32 renderer_flags = SDL_RENDERER_ACCELERATED;

// Conditionally set renderer flags for PS3
#ifdef PS3
// PS3-specific flag
renderer_flags |= SDL_RENDERER_SOFTWARE;
#endif

SDL_Renderer* renderer = SDL_CreateRenderer(window, -1, renderer_flags);
if (renderer == nullptr){
DebugLog << "Could not create renderer: " << SDL_GetError() << endl;
return 1;
Expand Down

0 comments on commit cfb670a

Please sign in to comment.