STDAPI_(const RGBQUAD *) GetBitmapPalette(const VIDEOINFOHEADER *pVideoInfo) { if (pVideoInfo->bmiHeader.biCompression == BI_BITFIELDS) { return TRUECOLOR(pVideoInfo)->bmiColors; } return COLORS(pVideoInfo); }
void Assignment1::Init() { rotateAngle = 1.9; translateX = -1; scaleAll = 0.3; triangle1start =18 ; // Init VBO here // Set background color to dark blue glClearColor(0.0f, 1.0f, 1.0f, 0.0f); // Generate a default VAO for now glGenVertexArrays(1, &m_vertexArrayID); glBindVertexArray(m_vertexArrayID); // Generate buffers glGenBuffers(NUM_GEOMETRY, &m_vertexBuffer[0]); glGenBuffers(NUM_GEOMETRY, &m_colorBuffer[0]); Bufferdata(); COLORS(); // Load vertex and fragment shaders m_programID = LoadShaders( "Shader//TransformVertexShader.vertexshader", "Shader//SimpleFragmentShader.fragmentshader"); // Use our shader glUseProgram(m_programID); // Enable depth test glEnable(GL_DEPTH_TEST); // Get a handle for our "MVP" uniform m_parameters[U_MVP] = glGetUniformLocation(m_programID, "MVP"); }
void html_engine_draw_table_cursor (HTMLEngine *e) { HTMLCursorRectangle *cr; HTMLTable *table; HTMLObject *to; static gboolean enabled = TRUE; if (!enabled) return; cr = &e->cursor_table; table = html_engine_get_table (e); to = HTML_OBJECT (table); if (table) { static gint offset = 0; gboolean animate; if (to != cr->object) { if (cr->object) refresh_under_cursor (e, cr, &enabled); cr->object = to; } html_object_calc_abs_position (to, &cr->x1, &cr->y2); cr->x2 = cr->x1 + to->width - 1; cr->y2--; cr->y1 = cr->y2 - (to->ascent + to->descent - 1); animate = HTML_IS_TABLE (e->cursor->object) && !html_engine_get_table_cell (e); if (animate) { offset++; offset %= 4; } draw_cursor_rectangle (e, cr->x1, cr->y1, cr->x2, cr->y2, COLORS (table), offset); } else if (cr->object) { refresh_under_cursor (e, cr, &enabled); cr->object = NULL; } }
void html_engine_draw_cell_cursor (HTMLEngine *e) { HTMLCursorRectangle *cr; HTMLTableCell *cell; HTMLObject *co; static gboolean enabled = TRUE; if (!enabled) return; cr = &e->cursor_cell; cell = html_engine_get_table_cell (e); co = HTML_OBJECT (cell); if (cell) { static gint offset = 0; gboolean animate; if (co != cr->object) { if (cr->object) refresh_under_cursor (e, cr, &enabled); cr->object = co; } html_object_calc_abs_position (co, &cr->x1, &cr->y2); cr->x2 = cr->x1 + co->width - 1; cr->y2 -= 2; cr->y1 = cr->y2 - (co->ascent + co->descent - 2); animate = !HTML_IS_IMAGE (e->cursor->object); if (animate) { offset++; offset %= 4; } draw_cursor_rectangle (e, cr->x1, cr->y1, cr->x2, cr->y2, COLORS (cell), offset); } else if (cr->object) { refresh_under_cursor (e, cr, &enabled); cr->object = NULL; } }