Fix GL error 1280 on windoze.
All checks were successful
Run ReCI Build Test / Explore-Gitea-Actions (push) Successful in 2m11s

This commit is contained in:
2025-01-30 14:18:42 -05:00
parent e8bfa7b6f0
commit 28bdc7f667
3 changed files with 5 additions and 8 deletions

View File

@@ -52,7 +52,7 @@ if (WIN32)
)
endif()
set(CMAKE_CXX_FLAGS "-O3 -Wall -Wextra")
#set(CMAKE_CXX_FLAGS "-O3 -Wall -Wextra")
file(COPY "assets" DESTINATION "${PROJECT_BINARY_DIR}")
file(GLOB_RECURSE ASSETS "assets/*")

View File

@@ -170,6 +170,7 @@ public:
/* if rendering to screen space directly. */
auto test_light = PointLight({2,1,2}, {pulse,pulse,pulse, 255}, {pulse, pulse, pulse, 255}, {0,0,0}, 1, 0.1, 0.01);
// If a 3D object has transparency. The things you'd like to see through it must be drawn before.
J3D::Begin();
J3D::DrawLine(Colors::Red, {-0.33,-0.125,1}, {-1,-0.125,1});
J3D::DrawLine(Colors::Red, {-0.33,-0.125,1}, {-0.33,0.25,1});
@@ -183,12 +184,7 @@ public:
AABB boxes[1] = {{Vector3(-0.2125, -0.2125,0.28750), Vector3(0.2125,0.2125,0.7125)}};
J3D::BatchWireframeAABB(Colors::Yellow, boxes, 1, 1);
//J3D::WireframeOBB(Colors::Red, {0, 0, 1.5f}, {0.40f, 0.10f, 0.10f}, {0,textAngle.y, 0});
//J3D::FillSphere({0,255,0,120}, sphere);
//J3D::DrawCubicBezierCurve(Colors::Blue, {0,0,0.3}, {0,0,0.5}, {0.2,0,0.3}, {0.2, 0.3, 0.1}, 30);
//J3D::WireframeIcosahedron(Colors::Green, {0,0,0.5f}, 0.125f, 1.f);
J3D::End();
J2D::Begin(j2d_render_target, true);
@@ -315,7 +311,7 @@ int main(int argc, char** argv) {
exit(-1);
window->initGL();
window->SetResizable(true);
window->SetVsyncEnabled(true);
window->SetVsyncEnabled(false);
std::ifstream file("assets/models/cube.amo");
if (!file.is_open())

View File

@@ -413,6 +413,7 @@ void JGL::J3D::WireframeAABB(const Color4& color, const Vector3& pos, const Vect
void JGL::J3D::BatchFillAABB(const Color4& color, const AABB* boxes, const size_t& box_count) {
if (!inJ3D)
Logger::Error("Drawing J3D element before J3D begin.");
glColor4ubv(color.ptr());
glBindBuffer(GL_ARRAY_BUFFER, ShapeCache::cube_vertex_data->GetHandle());
@@ -446,7 +447,7 @@ void JGL::J3D::BatchFillAABB(const Color4& color, const AABB* boxes, const size_
}
glColor4fv(OpenGLState::oldColor);
if (using_lights)
glDisable(GL_NORMAL_ARRAY);
glDisableClientState(GL_NORMAL_ARRAY);
glDisable(GL_CULL_FACE);
}
void JGL::J3D::FillAABB(const Color4& color, const Vector3& pos, const Vector3& radii) {