Added unproject
Broken and buggy font stuff Fixed some typos Fixed draw rect not using dim properly
This commit is contained in:
@@ -518,6 +518,8 @@ Vk_CommandBuffer *Vk_CommandBufferPush() {
|
||||
|
||||
vk.BeginCommandBuffer(result->handle, &begin_info);
|
||||
|
||||
frame->next_scratch += 1;
|
||||
|
||||
return result;
|
||||
}
|
||||
|
||||
|
||||
@@ -50,11 +50,19 @@ vec4 unorm_colour(uint c) {
|
||||
return result;
|
||||
}
|
||||
|
||||
vec2 rotate2f(vec2 v, float angle) {
|
||||
float s = sin(angle);
|
||||
float c = cos(angle);
|
||||
|
||||
vec2 result = vec2(c * v.x - s * v.y, s * v.x + c * v.y);
|
||||
return result;
|
||||
}
|
||||
|
||||
void main() {
|
||||
G_Rect rect = rects[gl_InstanceIndex];
|
||||
uint idx = indices[gl_VertexIndex];
|
||||
|
||||
vec2 p = (verticies[idx] * vec2(rect.w, rect.h)) + vec2(rect.x, rect.y);
|
||||
vec2 p = (rotate2f(verticies[idx], rect.angle) * vec2(rect.w, rect.h)) + vec2(rect.x, rect.y);
|
||||
|
||||
gl_Position = proj * vec4(p, 1.0f, 1.0f);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user