Make use_opengl local
The flag is used only locally, there is no need to store it in the screen structure.
This commit is contained in:
parent
c0c4ba7009
commit
862948b132
2 changed files with 2 additions and 5 deletions
|
@ -280,8 +280,8 @@ screen_init_rendering(struct screen *screen, const char *window_title,
|
|||
LOGI("Renderer: %s", renderer_name ? renderer_name : "(unknown)");
|
||||
|
||||
// starts with "opengl"
|
||||
screen->use_opengl = renderer_name && !strncmp(renderer_name, "opengl", 6);
|
||||
if (screen->use_opengl) {
|
||||
bool use_opengl = renderer_name && !strncmp(renderer_name, "opengl", 6);
|
||||
if (use_opengl) {
|
||||
struct sc_opengl *gl = &screen->gl;
|
||||
sc_opengl_init(gl);
|
||||
|
||||
|
@ -444,7 +444,6 @@ update_texture(struct screen *screen, const AVFrame *frame) {
|
|||
frame->data[2], frame->linesize[2]);
|
||||
|
||||
if (screen->mipmaps) {
|
||||
assert(screen->use_opengl);
|
||||
SDL_GL_BindTexture(screen->texture, NULL, NULL);
|
||||
screen->gl.GenerateMipmap(GL_TEXTURE_2D);
|
||||
SDL_GL_UnbindTexture(screen->texture);
|
||||
|
|
|
@ -16,7 +16,6 @@ struct screen {
|
|||
SDL_Window *window;
|
||||
SDL_Renderer *renderer;
|
||||
SDL_Texture *texture;
|
||||
bool use_opengl;
|
||||
struct sc_opengl gl;
|
||||
struct size frame_size;
|
||||
struct size content_size; // rotated frame_size
|
||||
|
@ -41,7 +40,6 @@ struct screen {
|
|||
.window = NULL, \
|
||||
.renderer = NULL, \
|
||||
.texture = NULL, \
|
||||
.use_opengl = false, \
|
||||
.gl = {0}, \
|
||||
.frame_size = { \
|
||||
.width = 0, \
|
||||
|
|
Loading…
Reference in a new issue