OpenGLUT Documentation
Introduction | Documentation | Examples | Proposals | Authors | Copying | Todo | Bugs | Links

OpenGLUT Unicode API Proposal

Note:
This is a proposal is a work-in-progress, for the purpose of discussion development. The Author is American, and does not regularly use Uniciode. Therefore, input from international language users is appreciated. This API is not currently implemented in OpenGLUT.

Motivation

Wide characters (Unicode or Multi-Byte) have never been a significant aspect of OpenGL, or of ANSI C in general. However, Unicode support has become a standard operating system feature, and is being incorporated into most libraries that support text operations. Furthermore, OpenGLUT is still in the process of defining the API for the first final release. This is an excellent time to add Unicode support, which will likely be incorporated at some time anyhow.

Wide characters (16 bit) are already represented by a few areas of OpenGL. They have always been supported by GLUT's glutBitmapCharacter, although not by glutBitmapLength or glutStrokeLength. GLU now supports Unicode with gluErrorUnicodeString().

It is possible that many functions can already support wide characters using UTF-8, which can be passed as character pointers. Therefore, this entire proposal may not be essential for international language support. However, due to the complexity of parsing UTF-8, it is valuable to at least include Unicode support for text rendering functions.

Description

Unicode should be supported for all strings that are intended for displaying text at run time, including Text rendering, menus, and window titles. It is possible that many functions can already support wide characters using UTF-8.

Unicode functions should be available under the same name, with a common name modifier. Rather than Inserting the word "Unicode", this proposal defines functions with a less verbose modifier, a single letter 'W' appended to the standard function name, the standard used by Microsoft. If there are objections to the use of a Microsoft standard, a 'U' suffix could be used instead.

API function

    int glutCreateWindowW( const wchar_t *title );
    void glutSetWindowTitleW( const wchar_t *title );
    void glutSetIconTitleW( const wchar_t *title );
    void glutAddMenuEntryW( const wchar_t *label, int value );
    void glutAddSubMenuW( const wchar_t *label, int submenu );
    void glutChangeToMenuEntryW( int item, const wchar_t *label, int value );
    void glutChangeToSubMenuW( int item, const wchar_t *label, int submenu );
    int glutExtensionSupportedW( const wchar_t *name );
    int glutBitmapLengthW( void *font, const wchar_t *string );
    int glutStrokeLengthW( void *font, const wchar_t *string );
    float glutStrokeLengthfW( void *font, const wchar_t *string );
    int glutBitmapStringW( void *font, const wchar_t *string );
    

Parameters: identical to the existinf GLUT API counterparts, with strings passed as wchar_t* instead of char*.

Unicode versions of glutInitDisplayString and glutInitDisplayModeString are not included, because the strings have a programmatic syntax, and are not displayed to the user.



OpenGLUT Development @ Sourceforge
Homepage | Summary | Files | CVS | Forums | Lists | Bugs | RFE

Generated on Sat Feb 5 01:47:28 2005 for OpenGLUT by doxygen 1.3.9.1
The OpenGLUT project is hosted by sourceforge.net.