forked from blender/blender
Move to use the GPU API instead OpenGL #23
@ -209,11 +209,11 @@ void GLTexture::draw(float x, float y)
|
|||||||
float texcoord[8] = {0.0, 0.0, 1.0, 0.0, 1.0, 1.0, 0.0, 1.0};
|
float texcoord[8] = {0.0, 0.0, 1.0, 0.0, 1.0, 1.0, 0.0, 1.0};
|
||||||
|
|
||||||
GPUVertFormat format = {0};
|
GPUVertFormat format = {0};
|
||||||
GPU_vertformat_attr_add(&format, "pos", GPU_COMP_F32, 8, GPU_FETCH_FLOAT);
|
GPU_vertformat_attr_add(&format, "pos", GPU_COMP_F32, 2, GPU_FETCH_FLOAT);
|
||||||
GPU_vertformat_attr_add(&format, "texCoord", GPU_COMP_F32, 8, GPU_FETCH_FLOAT);
|
GPU_vertformat_attr_add(&format, "texCoord", GPU_COMP_F32, 2, GPU_FETCH_FLOAT);
|
||||||
|
|
||||||
GPUVertBuf *vertex_buffer = GPU_vertbuf_create_with_format(&format);
|
GPUVertBuf *vertex_buffer = GPU_vertbuf_create_with_format(&format);
|
||||||
GPU_vertbuf_data_alloc(vertex_buffer, 2);
|
GPU_vertbuf_data_alloc(vertex_buffer, 4);
|
||||||
GPU_vertbuf_attr_fill(vertex_buffer, 0, position);
|
GPU_vertbuf_attr_fill(vertex_buffer, 0, position);
|
||||||
GPU_vertbuf_attr_fill(vertex_buffer, 1, texcoord);
|
GPU_vertbuf_attr_fill(vertex_buffer, 1, texcoord);
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user