OpenGLEAN
OpenGLEAN User Support
Home page | Introduction | Documentation | Files | Examples | Proposals | Authors | Links


OpenGLEAN Development
Summary | CVS | (discussion via home page) | (contact via home page) | (suggestion box) | License | Todo | Bugs

Unicode API Proposal

Note:
This is a proposal is a work-in-progress, for the purpose of discussion development. The author uses English, and does not regularly use Uniciode. Therefore, input from international language users is appreciated.

This proposal talks about Unicode output, and to that extent is really apropos only for gleanfonts. However, there is also the input side which this proposal or a similar one could address.

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, OpenGLEAN 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 existing 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.



SourceForge.net Logo Supported in part by SourceForge.net.

Generated on Fri Sep 16 20:15:32 2005 for OpenGLEAN by doxygen 1.4.3
The OpenGLEAN project is hosted by olib.org and SourceForge.