Skip to content

Added orthographic mode#6

Open
tobleroneaddict wants to merge 7 commits intoVogtinator:masterfrom
tobleroneaddict:master
Open

Added orthographic mode#6
tobleroneaddict wants to merge 7 commits intoVogtinator:masterfrom
tobleroneaddict:master

Conversation

@tobleroneaddict
Copy link

Orthographic mode can now be set using nglSetProjectionMode(GLProjectionMode::GL_PROJECTION_ORTHOGRAPHIC)
And can be reset with GL_PROJECTION_PERSPECTIVE.

Also cleaned up one compiler warning with is_monochrome as it is never used on non-nspire systems

Added nglSetProjectionMode
Added nglSetProjectionMode
add nglSetProjectionMode, readd error
gl.cpp Outdated
#ifdef _TINSPIRE
static bool is_monochrome;
#endif
static COLOR *screen_inverted; //For monochrome calcs
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can you put that into the #ifdef block above as well and put the only remaining use below into an #ifdef as well for consistency?

void nglPerspective(VERTEX *v)
{
if (projection_mode == GL_PROJECTION_ORTHOGRAPHIC)
return; //Ortho mode
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Needs blank line after this


void nglPerspective(VERTEX *v)
{
if (projection_mode == GL_PROJECTION_ORTHOGRAPHIC)
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I wonder if this is the right place. Arguably the projection should only be applied to actual drawing, not when calling nglPerspective manually? Not sure about use cases.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It felt less verbose than adding it to every usage of nglPerspective().

tobleroneaddict and others added 3 commits February 23, 2026 08:26
style

Co-authored-by: Fabian Vogt <fabian@ritter-vogt.de>
styling
moved things
Copy link
Author

@tobleroneaddict tobleroneaddict left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Rearranged projection mode, fixed preprocessor directives.

new line
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants