فهرست منبع

Removed SDL_HINT_RENDER_OPENGL_SHADERS

Shaders are always used if they are available.
Sam Lantinga 1 سال پیش
والد
کامیت
7cb1ca60ec
4فایلهای تغییر یافته به همراه2 افزوده شده و 16 حذف شده
  1. 1 0
      docs/README-migration.md
  2. 0 11
      include/SDL3/SDL_hints.h
  3. 1 3
      src/render/opengl/SDL_render_gl.c
  4. 0 2
      test/testautomation_hints.c

+ 1 - 0
docs/README-migration.md

@@ -710,6 +710,7 @@ The following hints have been removed:
 * SDL_HINT_MOUSE_RELATIVE_SCALING - mouse coordinates are no longer automatically scaled by the SDL renderer
 * SDL_HINT_RENDER_BATCHING - Render batching is always enabled, apps should call SDL_FlushRenderer() before calling into a lower-level graphics API.
 * SDL_HINT_RENDER_LOGICAL_SIZE_MODE - the logical size mode is explicitly set with SDL_SetRenderLogicalPresentation()
+* SDL_HINT_RENDER_OPENGL_SHADERS - shaders are always used if they are available
 * SDL_HINT_THREAD_STACK_SIZE - the stack size can be specified using SDL_CreateThreadWithStackSize()
 * SDL_HINT_VIDEO_FOREIGN_WINDOW_OPENGL - replaced with the "opengl" property in SDL_CreateWindowWithProperties()
 * SDL_HINT_VIDEO_FOREIGN_WINDOW_VULKAN - replaced with the "vulkan" property in SDL_CreateWindowWithProperties()

+ 0 - 11
include/SDL3/SDL_hints.h

@@ -1765,17 +1765,6 @@ extern "C" {
  */
 #define SDL_HINT_RENDER_METAL_PREFER_LOW_POWER_DEVICE "SDL_RENDER_METAL_PREFER_LOW_POWER_DEVICE"
 
-/**
- * A variable controlling whether the OpenGL render driver uses shaders if they are available.
- *
- * The variable can be set to the following values:
- *   "0"       - Disable shaders.
- *   "1"       - Enable shaders. (default)
- *
- * This hint should be set before creating a renderer.
- */
-#define SDL_HINT_RENDER_OPENGL_SHADERS      "SDL_RENDER_OPENGL_SHADERS"
-
 /**
  * A variable controlling whether vsync is automatically disabled if doesn't reach enough FPS.
  *

+ 1 - 3
src/render/opengl/SDL_render_gl.c

@@ -1837,9 +1837,7 @@ static SDL_Renderer *GL_CreateRenderer(SDL_Window *window, SDL_PropertiesID crea
     }
 
     /* Check for shader support */
-    if (SDL_GetHintBoolean(SDL_HINT_RENDER_OPENGL_SHADERS, SDL_TRUE)) {
-        data->shaders = GL_CreateShaderContext();
-    }
+    data->shaders = GL_CreateShaderContext();
     SDL_LogInfo(SDL_LOG_CATEGORY_RENDER, "OpenGL shaders: %s",
                 data->shaders ? "ENABLED" : "DISABLED");
 #if SDL_HAVE_YUV

+ 0 - 2
test/testautomation_hints.c

@@ -16,7 +16,6 @@ static const char *HintsEnum[] = {
     SDL_HINT_ORIENTATIONS,
     SDL_HINT_RENDER_DIRECT3D_THREADSAFE,
     SDL_HINT_RENDER_DRIVER,
-    SDL_HINT_RENDER_OPENGL_SHADERS,
     SDL_HINT_RENDER_SCALE_QUALITY,
     SDL_HINT_RENDER_VSYNC,
     SDL_HINT_TIMER_RESOLUTION,
@@ -37,7 +36,6 @@ static const char *HintsVerbose[] = {
     "SDL_ORIENTATIONS",
     "SDL_RENDER_DIRECT3D_THREADSAFE",
     "SDL_RENDER_DRIVER",
-    "SDL_RENDER_OPENGL_SHADERS",
     "SDL_RENDER_SCALE_QUALITY",
     "SDL_RENDER_VSYNC",
     "SDL_TIMER_RESOLUTION",