editor scaling and rotation

This commit is contained in:
John Alanbrook 2023-02-05 04:53:54 +00:00
parent 229e86a56a
commit 32ccc02a93
3 changed files with 9 additions and 23 deletions

View file

@ -460,6 +460,10 @@ duk_ret_t duk_cmd(duk_context *duk) {
case 45: case 45:
vect2duk(mouse_pos); vect2duk(mouse_pos);
return 1; return 1;
case 46:
set_mouse_mode(duk_to_int(duk, 1));
return 0;
} }
return 0; return 0;

View file

@ -100,6 +100,11 @@ static void mb_cb(GLFWwindow *w, int button, int action, int mods)
call_input_signal(keystr); call_input_signal(keystr);
} }
void set_mouse_mode(int mousemode)
{
glfwSetInputMode(mainwin->window, GLFW_CURSOR, mousemode);
}
void input_init() void input_init()
{ {
glfwSetCursorPosCallback(mainwin->window, cursor_pos_cb); glfwSetCursorPosCallback(mainwin->window, cursor_pos_cb);

View file

@ -203,29 +203,6 @@ int main(int argc, char **args) {
} }
} }
renderlag += elapsed;
if (renderlag >= renderMS) {
renderlag -= renderMS;
window_renderall();
}
gameobjects_cleanup();
}
renderlag += elapsed;
if (renderlag >= renderMS) {
renderlag -= renderMS;
window_renderall();
}
gameobjects_cleanup();
}
renderlag += elapsed; renderlag += elapsed;
if (renderlag >= renderMS) { if (renderlag >= renderMS) {