[core] Use init list for shader attributes
Shader parent object has been safely created, so it is safe to initialize the *Shader attributes via initialization list.
This commit is contained in:
@@ -8,9 +8,9 @@
|
||||
using namespace mbgl;
|
||||
|
||||
CollisionBoxShader::CollisionBoxShader(gl::GLObjectStore& glObjectStore)
|
||||
: Shader("collisionbox", shaders::collisionbox::vertex, shaders::collisionbox::fragment, glObjectStore) {
|
||||
a_extrude = MBGL_CHECK_ERROR(glGetAttribLocation(getID(), "a_extrude"));
|
||||
a_data = MBGL_CHECK_ERROR(glGetAttribLocation(getID(), "a_data"));
|
||||
: Shader("collisionbox", shaders::collisionbox::vertex, shaders::collisionbox::fragment, glObjectStore)
|
||||
, a_extrude(MBGL_CHECK_ERROR(glGetAttribLocation(getID(), "a_extrude")))
|
||||
, a_data(MBGL_CHECK_ERROR(glGetAttribLocation(getID(), "a_data"))) {
|
||||
}
|
||||
|
||||
void CollisionBoxShader::bind(GLbyte *offset) {
|
||||
|
||||
@@ -8,10 +8,10 @@
|
||||
using namespace mbgl;
|
||||
|
||||
IconShader::IconShader(gl::GLObjectStore& glObjectStore)
|
||||
: Shader("icon", shaders::icon::vertex, shaders::icon::fragment, glObjectStore) {
|
||||
a_offset = MBGL_CHECK_ERROR(glGetAttribLocation(getID(), "a_offset"));
|
||||
a_data1 = MBGL_CHECK_ERROR(glGetAttribLocation(getID(), "a_data1"));
|
||||
a_data2 = MBGL_CHECK_ERROR(glGetAttribLocation(getID(), "a_data2"));
|
||||
: Shader("icon", shaders::icon::vertex, shaders::icon::fragment, glObjectStore)
|
||||
, a_offset(MBGL_CHECK_ERROR(glGetAttribLocation(getID(), "a_offset")))
|
||||
, a_data1(MBGL_CHECK_ERROR(glGetAttribLocation(getID(), "a_data1")))
|
||||
, a_data2(MBGL_CHECK_ERROR(glGetAttribLocation(getID(), "a_data2"))) {
|
||||
}
|
||||
|
||||
void IconShader::bind(GLbyte* offset) {
|
||||
|
||||
@@ -8,8 +8,8 @@
|
||||
using namespace mbgl;
|
||||
|
||||
LineShader::LineShader(gl::GLObjectStore& glObjectStore)
|
||||
: Shader("line", shaders::line::vertex, shaders::line::fragment, glObjectStore) {
|
||||
a_data = MBGL_CHECK_ERROR(glGetAttribLocation(getID(), "a_data"));
|
||||
: Shader("line", shaders::line::vertex, shaders::line::fragment, glObjectStore)
|
||||
, a_data(MBGL_CHECK_ERROR(glGetAttribLocation(getID(), "a_data"))) {
|
||||
}
|
||||
|
||||
void LineShader::bind(GLbyte* offset) {
|
||||
|
||||
@@ -8,8 +8,8 @@
|
||||
using namespace mbgl;
|
||||
|
||||
LinepatternShader::LinepatternShader(gl::GLObjectStore& glObjectStore)
|
||||
: Shader("linepattern", shaders::linepattern::vertex, shaders::linepattern::fragment, glObjectStore) {
|
||||
a_data = MBGL_CHECK_ERROR(glGetAttribLocation(getID(), "a_data"));
|
||||
: Shader("linepattern", shaders::linepattern::vertex, shaders::linepattern::fragment, glObjectStore)
|
||||
, a_data(MBGL_CHECK_ERROR(glGetAttribLocation(getID(), "a_data"))) {
|
||||
}
|
||||
|
||||
void LinepatternShader::bind(GLbyte* offset) {
|
||||
|
||||
@@ -8,8 +8,8 @@
|
||||
using namespace mbgl;
|
||||
|
||||
LineSDFShader::LineSDFShader(gl::GLObjectStore& glObjectStore)
|
||||
: Shader("linesdfpattern", shaders::linesdfpattern::vertex, shaders::linesdfpattern::fragment, glObjectStore) {
|
||||
a_data = MBGL_CHECK_ERROR(glGetAttribLocation(getID(), "a_data"));
|
||||
: Shader("linesdfpattern", shaders::linesdfpattern::vertex, shaders::linesdfpattern::fragment, glObjectStore)
|
||||
, a_data(MBGL_CHECK_ERROR(glGetAttribLocation(getID(), "a_data"))) {
|
||||
}
|
||||
|
||||
void LineSDFShader::bind(GLbyte* offset) {
|
||||
|
||||
@@ -8,10 +8,10 @@
|
||||
using namespace mbgl;
|
||||
|
||||
SDFShader::SDFShader(gl::GLObjectStore& glObjectStore)
|
||||
: Shader("sdf", shaders::sdf::vertex, shaders::sdf::fragment, glObjectStore) {
|
||||
a_offset = MBGL_CHECK_ERROR(glGetAttribLocation(getID(), "a_offset"));
|
||||
a_data1 = MBGL_CHECK_ERROR(glGetAttribLocation(getID(), "a_data1"));
|
||||
a_data2 = MBGL_CHECK_ERROR(glGetAttribLocation(getID(), "a_data2"));
|
||||
: Shader("sdf", shaders::sdf::vertex, shaders::sdf::fragment, glObjectStore)
|
||||
, a_offset(MBGL_CHECK_ERROR(glGetAttribLocation(getID(), "a_offset")))
|
||||
, a_data1(MBGL_CHECK_ERROR(glGetAttribLocation(getID(), "a_data1")))
|
||||
, a_data2(MBGL_CHECK_ERROR(glGetAttribLocation(getID(), "a_data2"))) {
|
||||
}
|
||||
|
||||
void SDFGlyphShader::bind(GLbyte* offset) {
|
||||
|
||||
Reference in New Issue
Block a user