this repo has no description
0
fork

Configure Feed

Select the types of activity you want to include in your feed.

Added GPU_SetDepthFunction() and GPU_ComparisonEnum for #112.

+46
+21
include/SDL_gpu.h
··· 125 125 } GPU_RendererID; 126 126 127 127 128 + /*! \ingroup TargetControls 129 + * Comparison operations (for depth testing) 130 + * \see GPU_SetDepthFunction() 131 + * Values chosen for direct OpenGL compatibility. 132 + */ 133 + typedef enum { 134 + GPU_NEVER = 0x0200, 135 + GPU_LESS = 0x0201, 136 + GPU_EQUAL = 0x0202, 137 + GPU_LEQUAL = 0x0203, 138 + GPU_GREATER = 0x0204, 139 + GPU_NOTEQUAL = 0x0205, 140 + GPU_GEQUAL = 0x0206, 141 + GPU_ALWAYS = 0x0207 142 + } GPU_ComparisonEnum; 143 + 144 + 128 145 /*! \ingroup ImageControls 129 146 * Blend component functions 130 147 * \see GPU_SetBlendFunction() ··· 420 437 421 438 GPU_bool use_depth_test; 422 439 GPU_bool use_depth_write; 440 + GPU_ComparisonEnum depth_function; 423 441 424 442 /*! Renderer context data. NULL if the target does not represent a window or rendering context. */ 425 443 GPU_Context* context; ··· 1055 1073 1056 1074 /*! Enables or disables writing the depth (effective view z-coordinate) of new pixels to the depth buffer. Enabled by default, but you must call GPU_SetDepthTest() to use it. */ 1057 1075 DECLSPEC void SDLCALL GPU_SetDepthWrite(GPU_Target* target, GPU_bool enable); 1076 + 1077 + /*! Sets the operation to perform when depth testing. */ 1078 + DECLSPEC void SDLCALL GPU_SetDepthFunction(GPU_Target* target, GPU_ComparisonEnum compare_operation); 1058 1079 1059 1080 /*! \return The RGBA color of a pixel. */ 1060 1081 DECLSPEC SDL_Color SDLCALL GPU_GetPixel(GPU_Target* target, Sint16 x, Sint16 y);
+1
include/SDL_gpu_GLES_1.h
··· 69 69 70 70 GPU_bool last_depth_test; 71 71 GPU_bool last_depth_write; 72 + GPU_ComparisonEnum last_depth_function; 72 73 73 74 GPU_Image* last_image; 74 75 GPU_Target* last_target;
+1
include/SDL_gpu_GLES_2.h
··· 124 124 125 125 GPU_bool last_depth_test; 126 126 GPU_bool last_depth_write; 127 + GPU_ComparisonEnum last_depth_function; 127 128 128 129 GPU_Image* last_image; 129 130 GPU_Target* last_target;
+1
include/SDL_gpu_GLES_3.h
··· 128 128 129 129 GPU_bool last_depth_test; 130 130 GPU_bool last_depth_write; 131 + GPU_ComparisonEnum last_depth_function; 131 132 132 133 GPU_Image* last_image; 133 134 GPU_Target* last_target;
+1
include/SDL_gpu_OpenGL_1.h
··· 234 234 235 235 GPU_bool last_depth_test; 236 236 GPU_bool last_depth_write; 237 + GPU_ComparisonEnum last_depth_function; 237 238 238 239 GPU_Image* last_image; 239 240 GPU_Target* last_target;
+1
include/SDL_gpu_OpenGL_1_BASE.h
··· 49 49 50 50 GPU_bool last_depth_test; 51 51 GPU_bool last_depth_write; 52 + GPU_ComparisonEnum last_depth_function; 52 53 53 54 GPU_Image* last_image; 54 55 GPU_Target* last_target;
+1
include/SDL_gpu_OpenGL_2.h
··· 105 105 106 106 GPU_bool last_depth_test; 107 107 GPU_bool last_depth_write; 108 + GPU_ComparisonEnum last_depth_function; 108 109 109 110 GPU_Image* last_image; 110 111 GPU_Target* last_target;
+1
include/SDL_gpu_OpenGL_3.h
··· 168 168 169 169 GPU_bool last_depth_test; 170 170 GPU_bool last_depth_write; 171 + GPU_ComparisonEnum last_depth_function; 171 172 172 173 GPU_Image* last_image; 173 174 GPU_Target* last_target;
+1
include/SDL_gpu_OpenGL_4.h
··· 106 106 107 107 GPU_bool last_depth_test; 108 108 GPU_bool last_depth_write; 109 + GPU_ComparisonEnum last_depth_function; 109 110 110 111 GPU_Image* last_image; 111 112 GPU_Target* last_target;
+6
src/SDL_gpu.c
··· 546 546 target->use_depth_write = enable; 547 547 } 548 548 549 + void GPU_SetDepthFunction(GPU_Target* target, GPU_ComparisonEnum compare_operation) 550 + { 551 + if(target != NULL) 552 + target->depth_function = compare_operation; 553 + } 554 + 549 555 GPU_bool GPU_SetWindowResolution(Uint16 w, Uint16 h) 550 556 { 551 557 if(_gpu_current_renderer == NULL || _gpu_current_renderer->current_context_target == NULL || w == 0 || h == 0)
+11
src/renderer_GL_common.inl
··· 860 860 glDepthMask(enable); 861 861 } 862 862 863 + static void changeDepthFunction(GPU_Renderer* renderer, GPU_ComparisonEnum compare_operation) 864 + { 865 + GPU_CONTEXT_DATA* cdata = (GPU_CONTEXT_DATA*)renderer->current_context_target->context->data; 866 + if(cdata->last_depth_function == compare_operation) 867 + return; 868 + 869 + cdata->last_depth_function = compare_operation; 870 + glDepthFunc(compare_operation); 871 + } 872 + 863 873 static void prepareToRenderToTarget(GPU_Renderer* renderer, GPU_Target* target) 864 874 { 865 875 // Set up the camera 866 876 renderer->impl->SetCamera(renderer, target, &target->camera); 867 877 changeDepthTest(renderer, target->use_depth_test); 868 878 changeDepthWrite(renderer, target->use_depth_write); 879 + changeDepthFunction(renderer, target->depth_function); 869 880 } 870 881 871 882