SagarGaniga / computer-graphics

Beginners Guide to Computer Graphics in C/C++, OpenGL, JavaFX
MIT License
116 stars 54 forks source link

Undefined Function Error with getmaxheight() in Graphics.h for "Train" folder/file #3

Open shakilkhandev opened 2 months ago

shakilkhandev commented 2 months ago

Description:

I encountered an issue while using the graphics.h library in my project. Specifically, I received an "undefined function" error when trying to use getmaxheight(). This function does not seem to be recognized by the library, which is causing problems with the functionality of my program.

Steps to Reproduce:

  1. Use the graphics.h library in a C++ project.
  2. Attempt to call the function getmaxheight() to retrieve the height of the graphics window.

Expected Behavior:

The function getmaxheight() should return the maximum height of the graphics window.

Actual Behavior:

The compiler produces an "undefined function" error for getmaxheight().

Proposed Solution:

It appears that getmaxheight() might not be available in the current implementation of graphics.h. Based on the documentation and other examples, using getmaxy() instead of getmaxheight() might resolve this issue. I have updated my code to use getmaxy() and it seems to work as expected.

Here’s a quick example of how to replace getmaxheight() with getmaxy() in your code:


int h = getmaxy();
int w = getmaxx();
shakilkhandev commented 2 months ago

int h = getmaxy(); int w = getmaxx();

can be sloved by Replaced getmaxheight() with getmaxy(). Replaced getmaxwidth() with getmaxx().