-
Notifications
You must be signed in to change notification settings - Fork 550
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Textscreen: support for forcing software rendering #1444
base: master
Are you sure you want to change the base?
Textscreen: support for forcing software rendering #1444
Conversation
renderer = SDL_CreateRenderer(TXT_SDLWindow, -1, SDL_RENDERER_PRESENTVSYNC); | ||
|
||
if (renderer == NULL) | ||
if (txt_force_software_renderer || getenv("TXT_FORCE_SOFTWARE_RENDERER") != NULL) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This doesn't match coding style
Looks OK other than the code style. Do you want to rebase/squash this into one commit or should it be done when merging? |
Is there any reason not to just always use a software renderer for textscreen? It doesn't have the same performance requirements that the main binary has after all. Might be a simpler solution. |
There was a PR that made the textscreen and main game share the same renderer. How will that be affected by this change or always forcing software renderer for textscreen? |
This makes a lot of sense. I cannot envision any circumstance where textscreen needs hardware accel.
Sorry, I am very much a Go / Python / Typescript dev, not C. I will fix whatever is going on, but I'm not sure what I got wrong. Hints? |
Check |
Added a
TXT_SetForceSoftwareRenderer
function to set a global configuration flag for textscreen, plus support for aTXT_FORCE_SOFTWARE_RENDERER
environment variable. Setting either of these has the same effect on howSDL_CreateRenderer
is called as theforce_software_renderer
option in Choco's config does.Additionally, Setup and Endoom call
TXT_Init
, callTXT_SetForceSoftwareRenderer
as appropriate given the configurations they are operating under.Motivation for this change: I am using Chocolate Doom on a Raspberry Pi 1A, and while SDL can initialize its regular OpenGL environment, it is excruciatingly slow (0.5-1 FPS) even for something as simple as Textscreen. Forcing it to use software rendering instead of pretending to be a GPU fixes this.
Thus, this change greatly improves support of very low spec hardware.