Misc
Functions not falling into the categories above
oglfontNew
Section titled “oglfontNew”Prototype
Section titled “Prototype”HOGLFONT oglfontNew( const char *facename, int height, int weight = FW_NORMAL, int quality = ANTIALIASED_QUALITY )Function
Section titled “Function”- 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.
Parameters
Section titled “Parameters”- const char *facename : IN (Font name)
- int height : Font height
- int weight : Font weight
- int quality : Font quality
Return Value
Section titled “Return Value”- != NULL : The handle of the created font object
- == NULL : Fail
Prototype
Section titled “Prototype”HOGLFONT oglfontNew( LOGFONT *lf )Function
Section titled “Function”- 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.
Parameters
Section titled “Parameters”LOGFONT *lf : IN (Font information structure of Windows GDI )
Return Value
Section titled “Return Value”- != NULL : The handle of the created font object
- == NULL : Fail
oglfontDelete
Section titled “oglfontDelete”Prototype
Section titled “Prototype”HOGLFONT oglfontDelete( HOGLFONT font )Function
Section titled “Function”Releases the memory of the font object handle.
Parameters
Section titled “Parameters”HOGLFONT font : IN (Handle generated by function )
Return Value
Section titled “Return Value”항상 NULL
oglfontPrint
Section titled “oglfontPrint”Prototype
Section titled “Prototype”int oglfontPrint( HOGLFONT font, const char *str )Function
Section titled “Function”- 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.
Parameters
Section titled “Parameters”- HOGLFONT font : IN (Handle generated by function )
- const char *str : IN (String to display on screen, Null-terminated string)
Return Value
Section titled “Return Value”-
= 0 : Success
- < 0 : Fail
Prototype
Section titled “Prototype”int oglfontPrint( HOGLFONT font, double x, double y, COLORREF co, const char *str )Function
Section titled “Function”- 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
Parameters
Section titled “Parameters”- 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)
Return Value
Section titled “Return Value”-
= 0 : Success
- < 0 : Fail
oglfontGetTextSize
Section titled “oglfontGetTextSize”Prototype
Section titled “Prototype”void oglfontGetTextSize( HOGLFONT font, const char *str, int &sx, int &sy )Function
Section titled “Function”Calculates the size of the pixels needed to display characters on the font of the font object.
Parameters
Section titled “Parameters”- 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)
Return Value
Section titled “Return Value”None
oglfontPrintf
Section titled “oglfontPrintf”Prototype
Section titled “Prototype”int oglfontPrintf( HOGLFONT font, double x, double y, COLORREF co, const char *fmt, ... )Function
Section titled “Function”Parameters
Section titled “Parameters”- 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
Return Value
Section titled “Return Value”-
= 0 : Success
- < 0 : Fail
nauticalmile2meter
Section titled “nauticalmile2meter”Prototype
Section titled “Prototype”double nauticalmile2meter( double nm )Function
Section titled “Function”Transformation functions between the unit of the distance / velocity of the sea and the distance / velocity of the ground
Parameters
Section titled “Parameters”double nm : IN (Maritime distance)
Return Value
Section titled “Return Value”Ground distance
meter2nauticalmiler
Section titled “meter2nauticalmiler”Prototype
Section titled “Prototype”double meter2nauticalmiler( double m )Function
Section titled “Function”Transformation functions between the unit of the distance / velocity of the sea and the distance / velocity of the ground
Parameters
Section titled “Parameters”double m : IN (Ground speed)
Return Value
Section titled “Return Value”Maritime speed
knots2meterpersec
Section titled “knots2meterpersec”Prototype
Section titled “Prototype”double knots2meterpersec( double k )Function
Section titled “Function”Transformation functions between the unit of the distance / velocity of the sea and the distance / velocity of the ground
Parameters
Section titled “Parameters”double k : IN (Maritime speed)
Return Value
Section titled “Return Value”Ground speed
meterpersec2knots
Section titled “meterpersec2knots”Prototype
Section titled “Prototype”double meterpersec2knots( double m )Function
Section titled “Function”Transformation functions between the unit of the distance / velocity of the sea and the distance / velocity of the ground
Parameters
Section titled “Parameters”double m : Ground speed
Return Value
Section titled “Return Value”Maritime distance
wgs84toscr
Section titled “wgs84toscr”Prototype
Section titled “Prototype”double wgs84toscr( double lat )Function
Section titled “Function”Mercator Projection function
Parameters
Section titled “Parameters”double lat : IN (WGS84 latitude)
Return Value
Section titled “Return Value”SCR
scrtowgs84
Section titled “scrtowgs84”Prototype
Section titled “Prototype”double scrtowgs84( double mercator_y )Function
Section titled “Function”Mercator Projection function
Parameters
Section titled “Parameters”double mercator_y : IN (latitude)
Return Value
Section titled “Return Value”WGS84
knot2Kmh
Section titled “knot2Kmh”Prototype
Section titled “Prototype”double knot2Kmh( double speed )Function
Section titled “Function”Function to convert speed of knot unit to speed of Km / h unit
Parameters
Section titled “Parameters”double speed : IN (Speed [knot])
Return Value
Section titled “Return Value”Speed [Km/h]
Kmh2knot
Section titled “Kmh2knot”Prototype
Section titled “Prototype”double Kmh2knot( double speed )Function
Section titled “Function”Function to convert speed in Km / h to speed in knots
Parameters
Section titled “Parameters”double speed : IN (Speed [Km/h])
Return Value
Section titled “Return Value”Speed [knot]
rotatePos
Section titled “rotatePos”Prototype
Section titled “Prototype”void rotatePos( double &x, double &y, double radRot )Function
Section titled “Function”Function to calculate rotated coordinate values of x, y coordinates
Parameters
Section titled “Parameters”- double &x : OUT (coordinate value)
- double &y : OUT (coordinate value)
- double &radRot : IN (CW, radian value)
Return Value
Section titled “Return Value”None
Prototype
Section titled “Prototype”void rotatePos( double &x, double &y, double rotSin, double rotCos )Function
Section titled “Function”- Functions for reducing the amount of computation of sin () and cos () functions when rotating multiple coordinates
Parameters
Section titled “Parameters”- 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)
Return Value
Section titled “Return Value”None