int main() {
GLFW glfw;
Point_UV quad_points[] = {
{{-1, -1, 0}, {0, 0}},
{{ 1, -1, 0}, {1, 0}},
{{ 1, 1, 0}, {1, 1}},
{{-1, 1, 0}, {0, 1}},
};
u32 quad_ids[] = {0, 1, 2, 0, 2, 3};
glfwWindowHint(GLFW_VISIBLE, GLFW_FALSE);
GLFWwindow* global_window = glfwCreateWindow(1200, 800, "rfoegl", nullptr, nullptr);
glfwWindowHint(GLFW_VISIBLE, GLFW_TRUE);
Mesh quad_mesh;
u32 quad_shader;
{
Window win_0(1200, 800, global_window);
quad_mesh = make_mesh_uv((float*)quad_points, quad_ids, 4, 6);
quad_shader = get_shader_program_VF("./default.vert", "./uvmap.frag");
set_default_key_callback(&win_0);
while(!glfwWindowShouldClose(win_0.id)) {
glfwPollEvents();
draw_iteration(quad_shader, quad_mesh);
glfwSwapBuffers(win_0.id);
}
glDeleteProgram(quad_shader);
clear(quad_mesh);
}
{
Window win_1(1200, 800, global_window);
set_default_key_callback(&win_1);
while(!glfwWindowShouldClose(win_1.id)) {
glfwPollEvents();
draw_iteration(quad_shader, quad_mesh);
glfwSwapBuffers(win_1.id);
}
}
glDeleteProgram(quad_shader);
clear(quad_mesh);
return 0;
}
glfwWindowHint(GLFW_VISIBLE, GLFW_FALSE);
GLFWwindow* global_window = glfwCreateWindow(1200, 800, "rfoegl", nullptr, nullptr);
glfwWindowHint(GLFW_VISIBLE, GLFW_TRUE);
glfwMakeContextCurrent(global_window);
Mesh quad_mesh;
u32 quad_shader;
quad_mesh = make_mesh_uv((float*)quad_points, quad_ids, 4, 6);
quad_shader = get_shader_program_VF("./default.vert", "./uvmap.frag");