added new OpenGL wrapper

This commit is contained in:
Araq 2012-04-04 01:40:39 +02:00
commit b9f99565e9
7 changed files with 9624 additions and 15 deletions

View file

@ -489,6 +489,9 @@ Graphics libraries
* `wingl <wingl.html>`_ * `wingl <wingl.html>`_
Part of the wrapper for OpenGL. Part of the wrapper for OpenGL.
* `opengl <opengl.html>`_
New wrapper for OpenGL supporting up to version 4.2.
GUI libraries GUI libraries
------------- -------------

View file

@ -2567,11 +2567,11 @@ Type constraints
type parameter. Only the specified types are valid for instantiation: type parameter. Only the specified types are valid for instantiation:
.. code-block:: nimrod .. code-block:: nimrod
proc onlyIntOrString[T: int|string](x, y: T): T = nil proc onlyIntOrString[T: int|string](x, y: T) = nil
onlyIntOrString(45, 66) # valid
onlyIntOrString(56.0, 0.0) # type mismatch
onlyIntOrString(450, 616) # valid
onlyIntOrString(5.0, 0.0) # type mismatch
onlyIntOrString("xy", 50) # invalid as 'T' cannot be both at the same time
Apart from ordinary types, type constraints can also be of the Apart from ordinary types, type constraints can also be of the
following *type classes*: following *type classes*:

View file

@ -91,8 +91,9 @@ keywords, comments, operators, and other punctuation marks. Case is
``This_is_an_identifier`` and ``ThisIsAnIdentifier`` are the same identifier. ``This_is_an_identifier`` and ``ThisIsAnIdentifier`` are the same identifier.
This feature enables you to use other This feature enables you to use other
people's code without bothering about a naming convention that conflicts with people's code without bothering about a naming convention that conflicts with
yours. It also frees you from remembering the exact spelling of an identifier yours. A Nimrod-aware editor or IDE can show the identifiers as
(was it ``parseURL`` or ``parseUrl`` or ``parse_URL``?). preferred. It also frees you from remembering the exact spelling of an
identifier (was it ``parseURL`` or ``parseUrl`` or ``parse_URL``?).
String and character literals String and character literals
@ -117,16 +118,13 @@ Comments
-------- --------
`Comments`:idx: start anywhere outside a string or character literal with the `Comments`:idx: start anywhere outside a string or character literal with the
hash character ``#``. Documentation comments start with ``##``. hash character ``#``. Documentation comments start with ``##``. Multiline
Comments consist of a concatenation of `comment pieces`:idx:. A comment piece comments need to be aligned at the same column:
starts with ``#`` and runs until the end of the line. The end of line characters
belong to the piece. If the next line only consists of a comment piece which is
aligned to the preceding one, it does not start a new comment:
.. code-block:: nimrod .. code-block:: nimrod
i = 0 # This is a single comment over multiple lines belonging to the i = 0 # This is a single comment over multiple lines belonging to the
# assignment statement. The scanner merges these two pieces. # assignment statement.
# This is a new comment belonging to the current block, but to no particular # This is a new comment belonging to the current block, but to no particular
# statement. # statement.
i = i + 1 # This a new comment that is NOT i = i + 1 # This a new comment that is NOT
@ -1206,7 +1204,7 @@ Traced references are declared with the **ref** keyword, untraced references
are declared with the **ptr** keyword. are declared with the **ptr** keyword.
The empty ``[]`` subscript notation can be used to *derefer* a reference, The empty ``[]`` subscript notation can be used to *derefer* a reference,
meaning to retrieve the item the reference points to. The ``addr`` procedure meaning to retrieve the item the reference points to. The ``addr`` operator
returns the address of an item. An address is always an untraced reference: returns the address of an item. An address is always an untraced reference:
``addr`` is an *unsafe* feature. ``addr`` is an *unsafe* feature.

View file

@ -18,6 +18,8 @@ type
LONG* = int LONG* = int
WINBOOL* = int32 WINBOOL* = int32
DWORD* = int32 DWORD* = int32
HDC* = THandle
HGLRC* = THandle
TSECURITY_ATTRIBUTES* {.final, pure.} = object TSECURITY_ATTRIBUTES* {.final, pure.} = object
nLength*: int32 nLength*: int32

File diff suppressed because it is too large Load diff

View file

@ -49,6 +49,7 @@ Bugs
- bug: stress testing basic method example (eval example) - bug: stress testing basic method example (eval example)
without ``-d:release`` leaks memory? without ``-d:release`` leaks memory?
- bug: object {.pure, final.} does not work again! - bug: object {.pure, final.} does not work again!
- bug: {.error: "msg".} produces invalid pragma message
- bug: tsortdev does not run with native GC? - bug: tsortdev does not run with native GC?
- bug: pragma statements in combination with symbol files are evaluated twice - bug: pragma statements in combination with symbol files are evaluated twice
but this can lead to compilation errors but this can lead to compilation errors
@ -74,7 +75,6 @@ version 0.9.XX
- checked exceptions - checked exceptions
- make pegs support a compile-time option and make c2nim use regexes instead - make pegs support a compile-time option and make c2nim use regexes instead
per default? per default?
- fix implicit generic routines
- 'const' objects including case objects - 'const' objects including case objects
- improve docgen to use the semantic pass - improve docgen to use the semantic pass
- 'export' feature (requires improved docgen) - 'export' feature (requires improved docgen)
@ -101,7 +101,6 @@ version 0.9.XX
Library Library
------- -------
- provide more up to date OpenGL headers
- wrappers for mongodb; poppler; libharu - wrappers for mongodb; poppler; libharu
- suffix trees - suffix trees
- locale support; i18n module - locale support; i18n module

View file

@ -28,6 +28,7 @@ Library Additions
- Added ``strutils.parseEnum``. - Added ``strutils.parseEnum``.
- The stdlib can now be avoided to a point where C code generation for 16bit - The stdlib can now be avoided to a point where C code generation for 16bit
micro controllers is feasible. micro controllers is feasible.
- Added a new OpenGL wrapper that supports OpenGL up to version 4.2.
Changes affecting backwards compatibility Changes affecting backwards compatibility