| 154 | |
| 155 | |
| 156 | void ccDrawLine( const DPoint& origin, const DPoint& destination ) |
| 157 | { |
| 158 | lazy_init(); |
| 159 | |
| 160 | ccVertex2F vertices[2] = { |
| 161 | {origin.x, origin.y}, |
| 162 | {destination.x, destination.y} |
| 163 | }; |
| 164 | |
| 165 | s_pShader->use(); |
| 166 | s_pShader->setUniformsForBuiltins(); |
| 167 | s_pShader->setUniformLocationWith4fv(s_nColorLocation, (GLfloat*) &s_tColor.r, 1); |
| 168 | |
| 169 | ccGLEnableVertexAttribs( kCCVertexAttribFlag_Position ); |
| 170 | #ifdef EMSCRIPTEN |
| 171 | setGLBufferData(vertices, 16); |
| 172 | glVertexAttribPointer(kCCVertexAttrib_Position, 2, GL_FLOAT, GL_FALSE, 0, 0); |
| 173 | #else |
| 174 | glVertexAttribPointer(kCCVertexAttrib_Position, 2, GL_FLOAT, GL_FALSE, 0, vertices); |
| 175 | #endif // EMSCRIPTEN |
| 176 | glDrawArrays(GL_LINES, 0, 2); |
| 177 | } |
| 178 | |
| 179 | void ccDrawRect( DPoint origin, DPoint destination ) |
| 180 | { |
no test coverage detected