openframeworks / openFrameworks

openFrameworks is a community-developed cross platform toolkit for creative coding in C++.
http://openframeworks.cc
Other
9.98k stars 2.55k forks source link

[ios simulator] - setupScreenPerspective failing with a NaN #8115

Open dimitre opened 2 months ago

dimitre commented 2 months ago

it seems a variable called float aspect becomes a NaN after a division by zero it seems this piece of code is returning some weird values (probably uninitialized memory) on simulator

ofRectangle ofGLRenderer::getNativeViewport() const {
    GLint viewport[4]; // Where The Viewport Values Will Be Stored
    glGetIntegerv(GL_VIEWPORT, viewport);
Screenshot 2024-09-07 at 11 53 12

it seems glGetIntegerv(GL_VIEWPORT, viewport); and it is not changing values in array returning one arbitrary rectangle

steps to reproduce: just test an empty project on simulator

danoli3 commented 2 months ago

Emulator maybe need to wait till first frame