void Render::draw(Camera *camera, Container& container) { glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT); glUseProgram(shader->getProgramID()); glEnableVertexAttribArray(0); glBindBuffer(GL_ARRAY_BUFFER, vertexbuffer); glVertexAttribPointer(0, 3, GL_FLOAT, GL_FALSE, 0, (void*)0); //glEnableVertexAttribArray(1); //glBindBuffer(GL_ARRAY_BUFFER, colorbuffer); //glVertexAttribPointer(1, 3, GL_FLOAT, GL_FALSE, 0, (void*)0); glEnableVertexAttribArray(2); glBindBuffer(GL_ARRAY_BUFFER, normalbuffer); glVertexAttribPointer(2, 3, GL_FLOAT, GL_FALSE, 0, (void*)0); glUniformMatrix4fv(camera->get_projection_location(), 1, GL_FALSE, camera->get_projection_matrix()); glUniformMatrix4fv(camera->get_view_location(), 1, GL_FALSE, camera->get_view_matrix()); glUniformMatrix4fv(camera->get_model_location(), 1, GL_FALSE, camera->get_model_matrix()); drawGrid(); drawContainer(container, camera); drawLayers(container.getLayers(), camera); glDisableVertexAttribArray(0); glDisableVertexAttribArray(1); glDisableVertexAttribArray(2); }
void drawNexuizPlayerSettingsTab(entity me) { if(cvar_string("_cl_name") == "Player") me.playerNameLabel.alpha = ((mod(time * 2, 2) < 1) ? 1 : 0); else me.playerNameLabel.alpha = me.playerNameLabelAlpha; drawContainer(me); }
/* Draw function of a window control */ int drawWindow(control* self, control* dummy_window, SDL_Rect dummy_parent) { int err = OK; if ((self != NULL) && (self->ctrl_type == ctrl_window)) { err = drawContainer(self,self,self->rect); if (err == OK) { if ((err = SDL_Flip(self->surface)) != OK) { printf("ERROR: failed to flip buffer: %s\n", SDL_GetError()); } } } return err; }
void ComponentContainer::drawAll() { //Render the container itself drawContainer(); //Draw reach GUI component _gameEngine->getUIManager()->beginRenderUI(); for(const std::shared_ptr<GUIComponent> component : iterator()) { if(!component->isVisible()) continue; //Ignore hidden/destroyed components component->draw(); } _gameEngine->getUIManager()->endRenderUI(); }
void drawAll(void) { int i, j; int piece; char done[PIECES + 1]; float m[4][4]; build_rotmatrix(m, curquat); glMatrixMode(GL_MODELVIEW); glLoadIdentity(); glTranslatef(0, 0, -10); glMultMatrixf(&(m[0][0])); glRotatef(180, 0, 0, 1); if (depth) { glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT); } else { glClear(GL_COLOR_BUFFER_BIT); } for (i = 1; i <= PIECES; i++) { done[i] = 0; } glLoadName(0); drawContainer(); for (i = 0; i < HEIGHT; i++) { for (j = 0; j < WIDTH; j++) { piece = thePuzzle[i][j]; if (piece == 0) continue; if (done[piece]) continue; done[piece] = 1; glLoadName(piece); if (piece == movingPiece) { drawBox(piece, move_x, move_y); } else { drawBox(piece, j, i); } } } }
void draw(Ego::GUI::DrawingContext& drawingContext) override { drawContainer(drawingContext); }
void VariablesDebugPanel::draw(DrawingContext& drawingContext) { drawContainer(drawingContext); drawAll(drawingContext); }