Skip to content

Misc

Functions not falling into the categories above

HOGLFONT oglfontNew( const char *facename, int height, int weight = FW_NORMAL, int quality = ANTIALIASED_QUALITY )
  • Create a font object.
  • After the font is created, it is possible to write characters. Each character is stored and cached in a texture form for each individual character.
  • Each argument used to create the font is the same as the argument used to create the GDI font.
  • const char *facename : IN (Font name)
  • int height : Font height
  • int weight : Font weight
  • int quality : Font quality
  • != NULL : The handle of the created font object
  • == NULL : Fail
HOGLFONT oglfontNew( LOGFONT *lf )
  • Create a font object.
  • After the font is created, it is possible to write characters. Each character is stored and cached in a texture form for each individual character.
  • Each argument used to create the font is the same as the argument used to create the GDI font.

LOGFONT *lf : IN (Font information structure of Windows GDI )

  • != NULL : The handle of the created font object
  • == NULL : Fail

HOGLFONT oglfontDelete( HOGLFONT font )

Releases the memory of the font object handle.

HOGLFONT font : IN (Handle generated by function )

항상 NULL


int oglfontPrint( HOGLFONT font, const char *str )
  • You can specify the color of text via glColorXX() and glEnable(GL_BLEND), and can spevify the postion of text by manipulating Model view matrix of OpenGL.
  • HOGLFONT font : IN (Handle generated by function )
  • const char *str : IN (String to display on screen, Null-terminated string)
  • = 0 : Success

  • < 0 : Fail
int oglfontPrint( HOGLFONT font, double x, double y, COLORREF co, const char *str )
  • Calculates the size of the pixels needed to display characters on the font of the font object.
  • Draws a string with the color specified in the font object’s font specified coordinates.
  • Simplified version of
  • HOGLFONT font : IN (Handle generated by function )
  • double x : IN (OpenGL x coordinate to display text)
  • double y : IN (OpenGL y coordinate to display text)
  • COLORREF co : IN (Text color)
  • const char *str : IN (String to display on screen, Null-terminated string)
  • = 0 : Success

  • < 0 : Fail

void oglfontGetTextSize( HOGLFONT font, const char *str, int &sx, int &sy )

Calculates the size of the pixels needed to display characters on the font of the font object.

  • HOGLFONT font : IN (Handle generated by function )
  • const char *str : IN (String to display on screen, Null-terminated string)
  • int &sx : OUT (Width of string, the number of pixels)
  • int &sy : OUT (Height of string, the number of pixels)

None


int oglfontPrintf( HOGLFONT font, double x, double y, COLORREF co, const char *fmt, ... )
  • HOGLFONT font : IN (Handle generated by function )
  • double x : IN (OpenGL x coordinate to display text)
  • double y : IN (OpenGL y coordinate to display text)
  • COLORREF co : IN (Text color)
  • const char *fmt : IN (The format of the string to display on the screen, Null-terminated string)
  • See printf function in C language
  • = 0 : Success

  • < 0 : Fail

double nauticalmile2meter( double nm )

Transformation functions between the unit of the distance / velocity of the sea and the distance / velocity of the ground

double nm : IN (Maritime distance)

Ground distance


double meter2nauticalmiler( double m )

Transformation functions between the unit of the distance / velocity of the sea and the distance / velocity of the ground

double m : IN (Ground speed)

Maritime speed


double knots2meterpersec( double k )

Transformation functions between the unit of the distance / velocity of the sea and the distance / velocity of the ground

double k : IN (Maritime speed)

Ground speed


double meterpersec2knots( double m )

Transformation functions between the unit of the distance / velocity of the sea and the distance / velocity of the ground

double m : Ground speed

Maritime distance


double wgs84toscr( double lat )

Mercator Projection function

double lat : IN (WGS84 latitude)

SCR


double scrtowgs84( double mercator_y )

Mercator Projection function

double mercator_y : IN (latitude)

WGS84


double knot2Kmh( double speed )

Function to convert speed of knot unit to speed of Km / h unit

double speed : IN (Speed [knot])

Speed [Km/h]


double Kmh2knot( double speed )

Function to convert speed in Km / h to speed in knots

double speed : IN (Speed [Km/h])

Speed [knot]


void rotatePos( double &x, double &y, double radRot )

Function to calculate rotated coordinate values of x, y coordinates

  • double &x : OUT (coordinate value)
  • double &y : OUT (coordinate value)
  • double &radRot : IN (CW, radian value)

None

void rotatePos( double &x, double &y, double rotSin, double rotCos )
  • Functions for reducing the amount of computation of sin () and cos () functions when rotating multiple coordinates
  • double &x : OUT (coordinate value)
  • double &y : OUT (coordinate value)
  • double radSin : IN (Sine value of rotation angle)
  • double radCos : IN (Cosine value of rotation angle)

None