1 | [[toc:]] |
---|
2 | [[tags: egg]] |
---|
3 | |
---|
4 | == Introduction |
---|
5 | |
---|
6 | > Note: ''This is a draft document for early discussion.'' |
---|
7 | |
---|
8 | The {{gl-display}} API defines a set of basic functions |
---|
9 | to create windows with OpenGL context, and access |
---|
10 | keyboard, mouse and window manager events. |
---|
11 | |
---|
12 | It should be possible to provide implementations on top |
---|
13 | of bare windowing systems or full-featured GUI libraries. |
---|
14 | |
---|
15 | == Interface |
---|
16 | |
---|
17 | === Level 0 |
---|
18 | |
---|
19 | The egg must register the feature {{'gl-display-level-0}} |
---|
20 | to be used with cond-expand and #+, and provides the |
---|
21 | following functions. |
---|
22 | |
---|
23 | * gl-display:create |
---|
24 | * gl-display:kill |
---|
25 | * gl-display:swap |
---|
26 | * gl-display:receive-event |
---|
27 | * gl-display:event-type |
---|
28 | * gl-display:event-x |
---|
29 | * gl-display:event-y |
---|
30 | * gl-display:event-time |
---|
31 | * gl-display:event-key |
---|
32 | * gl-display:width |
---|
33 | * gl-display:height |
---|
34 | * gl-display:screen-width |
---|
35 | * gl-display:screen-height |
---|
36 | |
---|
37 | ==== gl-dispay:create |
---|
38 | |
---|
39 | [procedure] (gl-display:create [PROPERTIES]) |
---|
40 | |
---|
41 | Creates and returns a (window-manager level) window with an OpenGL context |
---|
42 | or #f on failure. PROPERTIES is a list of symbols and numbers. If the |
---|
43 | list is the empty list, the created window has a (window-manager) border, |
---|
44 | a width of 100 pixels and a height of 100 pixels. The width, height, |
---|
45 | horizontal and vertical positions can be specified with a symbol followed by |
---|
46 | a number. The following additional symbols can also be used : |
---|
47 | |
---|
48 | * full-screen |
---|
49 | * ... |
---|
50 | |
---|
51 | The full-screen property is meant to create a window with the same size as |
---|
52 | the screen, not to change the screen resolution to match the window size. |
---|
53 | As such, if both window size and full-screen are given, the size information |
---|
54 | is discarded. |
---|
55 | |
---|
56 | Example usage : |
---|
57 | |
---|
58 | (gl-display:create 'width 320 'height 240 'no-border) |
---|
59 | |
---|
60 | ==== gl-display:swap |
---|
61 | |
---|
62 | [procedure] (gl-display:swap DISPLAY) |
---|
63 | |
---|
64 | Swaps the back buffer with the front buffer for a double buffering |
---|
65 | context or call glFlush for a single buffering context. |
---|
66 | |
---|
67 | == TODO |
---|
68 | |
---|
69 | * level based features (see Tony's proposal on the Chicken mailing-list : |
---|
70 | [[http://lists.gnu.org/archive/html/chicken-users/2007-02/msg00259.html]]). |
---|
71 | * in addition of features, discussion about possible versioning mechanisms. |
---|
72 | * color, depth, ... for the properties of gl-display:create. |
---|
73 | |
---|
74 | == Authors |
---|
75 | |
---|
76 | [[vo minh thu]] |
---|
77 | |
---|
78 | == Version History |
---|
79 | |
---|
80 | ; 0.1 : initial release (not yet, waiting for contributions before 0.1) |
---|
81 | |
---|