void Geometry::RenderSetup() { /* if (glMapBufferRange) { auto mem = (float *)glMapBufferRange(GL_ARRAY_BUFFER, 0, vertsize * nverts, GL_MAP_READ_BIT); printf("%x\n", mem); } */ SetAttribs(vbo, fmt.c_str(), (int)vertsize); }
void RenderArray(Shader *sh, Primitive prim, int count, const char *fmt, int vertsize, void *vbuf, int *ibuf) { sh->Set(); GLenum glprim = GetPrimitive(prim); SetAttribs(0, fmt, vertsize, (char *)vbuf); if (ibuf) { glBindBuffer(GL_ELEMENT_ARRAY_BUFFER, 0); glDrawElements(glprim, count, GL_UNSIGNED_INT, ibuf); } else glDrawArrays(glprim, 0, count); UnSetAttribs(fmt); }
void RenderArray(Primitive prim, int tcount, int vcount, const char *fmt, int vertsize1, uint vbo, uint ibo = 0, int vertsize2 = 0, uint vbo2 = 0) { GLenum glprim = GetPrimitive(prim); SetAttribs(vbo, fmt, vertsize1, vbo2, vertsize2); if (ibo) { glBindBuffer(GL_ELEMENT_ARRAY_BUFFER, ibo); glDrawElements(glprim, tcount, GL_UNSIGNED_INT, 0); } else { glDrawArrays(glprim, 0, vcount); } UnSetAttribs(fmt); }
void Geometry::RenderSetup() { SetAttribs(vboId, fmt, vertsize); }
ScreenItem::ScreenItem(uint8_t left, uint8_t top, uint8_t len, bool highlighted, const char *item) : dataItem((void*)item) { SetAttribs(left, top, len, highlighted, 1); }
ScreenItem::ScreenItem(uint8_t left, uint8_t top, uint8_t len, bool highlighted, DataItemBase *item) : dataItem(item) { SetAttribs(left, top, len, highlighted, 0); }