Fix bugs. Sketch3D stable.

This commit is contained in:
IlyaShurupov 2024-03-18 10:42:01 +03:00 committed by Ilya Shurupov
parent cd8feaf2c0
commit e065dc736b
9 changed files with 45 additions and 32 deletions

View file

@ -2,6 +2,8 @@
#include "FrameBuffer.hpp"
#include "GraphicsApi.hpp"
#include <stdio.h>
void glerr(GLenum type) { printf("GL ERROR\n"); }
#define AssertGL(x) { x; GLenum __gle = glGetError(); if (__gle != GL_NO_ERROR) glerr(__gle); }

View file

@ -14,7 +14,7 @@ void StrokeGPUHandles::sendDataToGPU(Buffer<StrokePoint>* mPoints) {
glBindVertexArray(VertexArrayID);
vbo_len = mPoints->size();
glBindBuffer(GL_ARRAY_BUFFER, vertexbuffer);
glBufferData(GL_ARRAY_BUFFER, sizeof(mPoints[0]) * vbo_len, mPoints->getBuff(), GL_DYNAMIC_DRAW);
glBufferData(GL_ARRAY_BUFFER, sizeof(StrokePoint) * vbo_len, mPoints->getBuff(), GL_STATIC_COPY);
}
StrokeGPUHandles::~StrokeGPUHandles() {
@ -340,7 +340,7 @@ Project::~Project() {
Renderer::Renderer(Vec2F size) :
mBuffer(size, 4),
mBufferDowncast(size),
mShader(".\\rsc\\shaders\\stroke.vert", ".\\rsc\\shaders\\stroke.geom", ".\\rsc\\shaders\\stroke.frag")
mShader("rsc/shaders/stroke.vert", "rsc/shaders/stroke.geom", "rsc/shaders/stroke.frag")
{
mMaxSize = size;