Install the GLCore way of doing input without all the legacy stuff

This commit is contained in:
Sam Gateau 2015-07-31 22:46:06 -07:00
parent d9d0f8dcfd
commit 6a8faca0ee
2 changed files with 10 additions and 5 deletions

View file

@ -16,7 +16,7 @@
<$declareStandardTransform()$> <$declareStandardTransform()$>
varying vec2 varTexcoord; out vec2 _texcoord;
void main(void) { void main(void) {
const vec4 UNIT_QUAD[4] = vec4[4]( const vec4 UNIT_QUAD[4] = vec4[4](
@ -34,5 +34,5 @@ void main(void) {
<$transformModelToWorldPos(obj, tc, tc)$> <$transformModelToWorldPos(obj, tc, tc)$>
gl_Position = pos; gl_Position = pos;
varTexcoord = tc.xy; _texcoord = tc.xy;
} }

View file

@ -57,7 +57,10 @@ void GLBackend::do_setInputBuffer(Batch& batch, uint32 paramOffset) {
} }
} }
#define NOT_SUPPORT_VAO #if (GPU_FEATURE_PROFILE == GPU_CORE)
#define SUPPORT_VAO
#endif
#if defined(SUPPORT_VAO) #if defined(SUPPORT_VAO)
#else #else
@ -95,8 +98,10 @@ void GLBackend::killInput() {
void GLBackend::syncInputStateCache() { void GLBackend::syncInputStateCache() {
#if defined(SUPPORT_VAO) #if defined(SUPPORT_VAO)
for (int i = 0; i < NUM_CLASSIC_ATTRIBS; i++) { for (int i = 0; i < _input._attributeActivation.size(); i++) {
_input._attributeActivation[i] = glIsEnabled(attributeSlotToClassicAttribName[i]); GLint active = 0;
glGetVertexAttribiv(i, GL_VERTEX_ATTRIB_ARRAY_ENABLED, &active);
_input._attributeActivation[i] = active;
} }
//_input._defaultVAO //_input._defaultVAO
glBindVertexArray(_input._defaultVAO); glBindVertexArray(_input._defaultVAO);