Changeset View
Changeset View
Standalone View
Standalone View
source/blender/gpu/intern/gpu_draw.c
| Context not available. | |||||
| #include <string.h> | #include <string.h> | ||||
| #include "GL/glew.h" | #include "GPU_glew.h" | ||||
| #include "BLI_blenlib.h" | #include "BLI_blenlib.h" | ||||
| #include "BLI_linklist.h" | #include "BLI_linklist.h" | ||||
| Context not available. | |||||
| return count; | return count; | ||||
| } | } | ||||
| void GPU_multisample(bool enable) | |||||
campbellbarton: should be `static` (and lowercase) | |||||
jwilkinsUnsubmitted Not Done Inline ActionsThis function is intended to be public. jwilkins: This function is intended to be public. | |||||
| { | |||||
| if (GLEW_VERSION_1_3 || GLEW_ARB_multisample) { | |||||
| #if __linux__ | |||||
| /* changing multisample enablement from the default (enabled) causes problems on some | |||||
| systems (NVIDIA/Linux) when the pixel format doesn't have a multisample buffer */ | |||||
| bool toggle_ok = true; | |||||
| if (GPU_type_matches(GPU_DEVICE_NVIDIA, GPU_OS_UNIX, GPU_DRIVER_ANY)) { | |||||
| int samples = 0; | |||||
| glGetIntegerv(GL_SAMPLES, &samples); | |||||
| if (samples == 0) | |||||
| toggle_ok = false; | |||||
| } | |||||
| if (toggle_ok) { | |||||
| if (enable) | |||||
| glEnable(GL_MULTISAMPLE); | |||||
| else | |||||
| glDisable(GL_MULTISAMPLE); | |||||
| } | |||||
| #else | |||||
| if (enable) | |||||
| glEnable(GL_MULTISAMPLE); | |||||
| else | |||||
| glDisable(GL_MULTISAMPLE); | |||||
| #endif | |||||
| } | |||||
| } | |||||
| /* Default OpenGL State */ | /* Default OpenGL State */ | ||||
| void GPU_state_init(void) | void GPU_state_init(void) | ||||
| Context not available. | |||||
| glCullFace(GL_BACK); | glCullFace(GL_BACK); | ||||
| glDisable(GL_CULL_FACE); | glDisable(GL_CULL_FACE); | ||||
| /* calling this makes drawing very slow when AA is not set up in ghost | GPU_multisample(false); | ||||
| * on Linux/NVIDIA. */ | |||||
| // glDisable(GL_MULTISAMPLE); | |||||
| } | } | ||||
| #ifdef DEBUG | #ifdef DEBUG | ||||
| Context not available. | |||||
should be static (and lowercase)