diff --git a/.gitmodules b/.gitmodules new file mode 100644 index 0000000..e396f64 --- /dev/null +++ b/.gitmodules @@ -0,0 +1,3 @@ +[submodule "webgl"] + path = webgl + url = https://git.gaetanbrochard.dev/gbrochar/webgl diff --git a/src/run.c b/src/run.c index 7905885..ddd3e21 100644 --- a/src/run.c +++ b/src/run.c @@ -117,13 +117,6 @@ static void RenderSceneCB(t_env *e) static void CreateVertexBuffer(t_env *e) { - printf("status of different buffers:\n"); - printf("vertices len %ld\n", e->object.vertices.ptr); - printf("uv len %ld\n", e->object.uvs.ptr); - printf("normals len %ld\n", e->object.normals.ptr); - printf("vertices indices len %ld\n", e->object.vertices_indices.ptr); - printf("uvs indices len %ld\n", e->object.uvs_indices.ptr); - printf("normals indices len %ld\n", e->object.normals_indices.ptr); e->is_good = 1; if (!(e->vbo_data = (float *)malloc(e->object.vertices_indices.ptr * 8 * sizeof(float)))) { perror("malloc"); @@ -149,11 +142,9 @@ static void CreateVertexBuffer(t_env *e) e->is_good = 0; } } - //printf("bruh\n"); glGenBuffers(1, &VBO); glBindBuffer(GL_ARRAY_BUFFER, VBO); glBufferData(GL_ARRAY_BUFFER, e->object.vertices_indices.ptr * 8 * sizeof(float), e->vbo_data, GL_STATIC_DRAW); - printf("Buffer created with success !\n"); /* glGenBuffers(1, &VBO); glBindBuffer(GL_ARRAY_BUFFER, VBO); glBufferData(GL_ARRAY_BUFFER, e->object.vertices.ptr * sizeof(double), e->object.vertices.data, GL_STATIC_DRAW); @@ -346,8 +337,7 @@ int run(t_env *e) return (FAILURE); /* Create a windowed mode window and its OpenGL context */ - //glfwWindowHint(GLFW_STEREO, GLFW_TRUE); - window = glfwCreateWindow(e->window.width, e->window.height, "Hello World", NULL, NULL); + window = glfwCreateWindow(e->window.width, e->window.height, "SC0P", NULL, NULL); glfwSetWindowUserPointer(window, e); glfwSetKeyCallback(window, key_callback); if (!window) @@ -359,8 +349,6 @@ int run(t_env *e) glfwMakeContextCurrent(window); index_count = e->object.vertices_indices.ptr; - //printf("%ld\n", e->object.vertices.ptr); - //printf("%ld\n", e->object.vertices_indices.ptr); GLenum res = glewInit(); if (res != GLEW_OK) { diff --git a/webgl b/webgl new file mode 160000 index 0000000..bb82f2d --- /dev/null +++ b/webgl @@ -0,0 +1 @@ +Subproject commit bb82f2dd4c32facefce26e26cb8d463fdb717302