MCPcopy Create free account
hub / github.com/cginternals/globjects / currentState

Method currentState

source/globjects/source/State.cpp:36–150  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

34}
35
36State * State::currentState()
37{
38 State * state = new State(DeferredMode);
39
40 std::vector<GLenum> capabilities = {
41 GL_BLEND,
42 GL_COLOR_LOGIC_OP,
43 GL_CULL_FACE,
44 GL_DEPTH_CLAMP,
45 GL_DEPTH_TEST,
46 GL_DITHER,
47 GL_FRAMEBUFFER_SRGB,
48 GL_LINE_SMOOTH,
49 GL_MULTISAMPLE,
50 GL_POLYGON_OFFSET_FILL,
51 GL_POLYGON_OFFSET_LINE,
52 GL_POLYGON_OFFSET_POINT,
53 GL_POLYGON_SMOOTH,
54 GL_PROGRAM_POINT_SIZE,
55 GL_RASTERIZER_DISCARD,
56 GL_SAMPLE_ALPHA_TO_COVERAGE,
57 GL_SAMPLE_ALPHA_TO_ONE,
58 GL_SAMPLE_COVERAGE,
59 GL_SAMPLE_MASK,
60 GL_SCISSOR_TEST,
61 GL_STENCIL_TEST
62 };
63
64 if (globjects::version() >= glbinding::Version(3, 1))
65 {
66 capabilities.push_back(GL_PRIMITIVE_RESTART);
67 if (hasExtension(GLextension::GL_ARB_ES3_compatibility))
68 {
69 capabilities.push_back(GL_PRIMITIVE_RESTART_FIXED_INDEX);
70 }
71 state->primitiveRestartIndex(getInteger(GL_PRIMITIVE_RESTART_INDEX));
72
73 if (hasExtension(GLextension::GL_ARB_sample_shading))
74 {
75 capabilities.push_back(GL_SAMPLE_SHADING);
76 }
77 if (hasExtension(GLextension::GL_ARB_seamless_cube_map))
78 {
79 capabilities.push_back(GL_TEXTURE_CUBE_MAP_SEAMLESS);
80 }
81 if (hasExtension(GLextension::GL_ARB_provoking_vertex))
82 {
83 state->provokingVertex(getEnum(GL_PROVOKING_VERTEX));
84 }
85 // is this necessary here? should be controlled by debugmessageoutput
86 if (hasExtension(GLextension::GL_KHR_debug))
87 {
88 capabilities.push_back(GL_DEBUG_OUTPUT);
89 capabilities.push_back(GL_DEBUG_OUTPUT_SYNCHRONOUS);
90 }
91 }
92
93 for (GLenum capability : capabilities)

Callers

nothing calls this directly

Calls 15

versionFunction · 0.85
hasExtensionFunction · 0.85
getIntegerFunction · 0.85
getEnumFunction · 0.85
isEnabledFunction · 0.85
getFloatFunction · 0.85
getBooleanFunction · 0.85
primitiveRestartIndexMethod · 0.80
provokingVertexMethod · 0.80
setEnabledMethod · 0.80
blendColorMethod · 0.80
blendFuncSeparateMethod · 0.80

Tested by

no test coverage detected