mirror of
https://github.com/nim-lang/Nim.git
synced 2025-12-29 01:14:41 +00:00
added new OpenGL wrapper
This commit is contained in:
@@ -489,6 +489,9 @@ Graphics libraries
|
||||
* `wingl <wingl.html>`_
|
||||
Part of the wrapper for OpenGL.
|
||||
|
||||
* `opengl <opengl.html>`_
|
||||
New wrapper for OpenGL supporting up to version 4.2.
|
||||
|
||||
|
||||
GUI libraries
|
||||
-------------
|
||||
|
||||
@@ -2567,11 +2567,11 @@ Type constraints
|
||||
type parameter. Only the specified types are valid for instantiation:
|
||||
|
||||
.. code-block:: nimrod
|
||||
proc onlyIntOrString[T: int|string](x, y: T): T = nil
|
||||
|
||||
onlyIntOrString(45, 66) # valid
|
||||
onlyIntOrString(56.0, 0.0) # type mismatch
|
||||
proc onlyIntOrString[T: int|string](x, y: T) = nil
|
||||
|
||||
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
|
||||
following *type classes*:
|
||||
|
||||
16
doc/tut1.txt
16
doc/tut1.txt
@@ -91,8 +91,9 @@ keywords, comments, operators, and other punctuation marks. Case is
|
||||
``This_is_an_identifier`` and ``ThisIsAnIdentifier`` are the same identifier.
|
||||
This feature enables you to use other
|
||||
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
|
||||
(was it ``parseURL`` or ``parseUrl`` or ``parse_URL``?).
|
||||
yours. A Nimrod-aware editor or IDE can show the identifiers as
|
||||
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
|
||||
@@ -117,16 +118,13 @@ Comments
|
||||
--------
|
||||
|
||||
`Comments`:idx: start anywhere outside a string or character literal with the
|
||||
hash character ``#``. Documentation comments start with ``##``.
|
||||
Comments consist of a concatenation of `comment pieces`:idx:. A comment piece
|
||||
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:
|
||||
hash character ``#``. Documentation comments start with ``##``. Multiline
|
||||
comments need to be aligned at the same column:
|
||||
|
||||
.. code-block:: nimrod
|
||||
|
||||
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
|
||||
# statement.
|
||||
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.
|
||||
|
||||
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:
|
||||
``addr`` is an *unsafe* feature.
|
||||
|
||||
|
||||
@@ -18,6 +18,8 @@ type
|
||||
LONG* = int
|
||||
WINBOOL* = int32
|
||||
DWORD* = int32
|
||||
HDC* = THandle
|
||||
HGLRC* = THandle
|
||||
|
||||
TSECURITY_ATTRIBUTES* {.final, pure.} = object
|
||||
nLength*: int32
|
||||
|
||||
9606
lib/wrappers/opengl/opengl.nim
Normal file
9606
lib/wrappers/opengl/opengl.nim
Normal file
File diff suppressed because it is too large
Load Diff
3
todo.txt
3
todo.txt
@@ -49,6 +49,7 @@ Bugs
|
||||
- bug: stress testing basic method example (eval example)
|
||||
without ``-d:release`` leaks memory?
|
||||
- bug: object {.pure, final.} does not work again!
|
||||
- bug: {.error: "msg".} produces invalid pragma message
|
||||
- bug: tsortdev does not run with native GC?
|
||||
- bug: pragma statements in combination with symbol files are evaluated twice
|
||||
but this can lead to compilation errors
|
||||
@@ -74,7 +75,6 @@ version 0.9.XX
|
||||
- checked exceptions
|
||||
- make pegs support a compile-time option and make c2nim use regexes instead
|
||||
per default?
|
||||
- fix implicit generic routines
|
||||
- 'const' objects including case objects
|
||||
- improve docgen to use the semantic pass
|
||||
- 'export' feature (requires improved docgen)
|
||||
@@ -101,7 +101,6 @@ version 0.9.XX
|
||||
Library
|
||||
-------
|
||||
|
||||
- provide more up to date OpenGL headers
|
||||
- wrappers for mongodb; poppler; libharu
|
||||
- suffix trees
|
||||
- locale support; i18n module
|
||||
|
||||
@@ -28,6 +28,7 @@ Library Additions
|
||||
- Added ``strutils.parseEnum``.
|
||||
- The stdlib can now be avoided to a point where C code generation for 16bit
|
||||
micro controllers is feasible.
|
||||
- Added a new OpenGL wrapper that supports OpenGL up to version 4.2.
|
||||
|
||||
|
||||
Changes affecting backwards compatibility
|
||||
|
||||
Reference in New Issue
Block a user