mirror of
https://github.com/Motorhead1991/qemu.git
synced 2025-07-27 04:13:53 -06:00
console-gl: add opengl rendering helper functions
Signed-off-by: Gerd Hoffmann <kraxel@redhat.com> Reviewed-by: Max Reitz <mreitz@redhat.com>
This commit is contained in:
parent
985e1c9b00
commit
cd2bc889e5
9 changed files with 247 additions and 1 deletions
19
ui/shader.c
19
ui/shader.c
|
@ -29,6 +29,25 @@
|
|||
|
||||
/* ---------------------------------------------------------------------- */
|
||||
|
||||
void qemu_gl_run_texture_blit(GLint texture_blit_prog)
|
||||
{
|
||||
GLfloat in_position[] = {
|
||||
-1, -1,
|
||||
1, -1,
|
||||
-1, 1,
|
||||
1, 1,
|
||||
};
|
||||
GLint l_position;
|
||||
|
||||
glUseProgram(texture_blit_prog);
|
||||
l_position = glGetAttribLocation(texture_blit_prog, "in_position");
|
||||
glVertexAttribPointer(l_position, 2, GL_FLOAT, GL_FALSE, 0, in_position);
|
||||
glEnableVertexAttribArray(l_position);
|
||||
glDrawArrays(GL_TRIANGLE_STRIP, l_position, 4);
|
||||
}
|
||||
|
||||
/* ---------------------------------------------------------------------- */
|
||||
|
||||
GLuint qemu_gl_create_compile_shader(GLenum type, const GLchar *src)
|
||||
{
|
||||
GLuint shader;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue