Move to use the GPU API instead OpenGL #23

Merged
Bogdan Nagirniak merged 9 commits from BLEN-371 into hydra-render 2023-04-07 13:28:49 +02:00
Showing only changes of commit df16bbff50 - Show all commits

View File

@ -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};
GPUVertFormat format = {0};
GPU_vertformat_attr_add(&format, "pos", GPU_COMP_F32, 8, GPU_FETCH_FLOAT);
GPU_vertformat_attr_add(&format, "texCoord", 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, 2, GPU_FETCH_FLOAT);
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, 1, texcoord);