KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > eclipse > swt > internal > opengl > win32 > WGL


1 /*******************************************************************************
2  * Copyright (c) 2000, 2007 IBM Corporation and others.
3  * All rights reserved. This program and the accompanying materials
4  * are made available under the terms of the Eclipse Public License v1.0
5  * which accompanies this distribution, and is available at
6  * http://www.eclipse.org/legal/epl-v10.html
7  *
8  * Contributors:
9  * IBM Corporation - initial API and implementation
10  *******************************************************************************/

11 package org.eclipse.swt.internal.opengl.win32;
12
13 import org.eclipse.swt.internal.*;
14
15 public class WGL extends Platform {
16     static {
17         Library.loadLibrary("swt-wgl");
18     }
19     
20     public static final int WGL_FONT_LINES = 0;
21     public static final int WGL_FONT_POLYGONS = 1;
22     
23     /* LAYERPLANEDESCRIPTOR flags */
24     public static final int LPD_DOUBLEBUFFER = 0x00000001;
25     public static final int LPD_STEREO = 0x00000002;
26     public static final int LPD_SUPPORT_GDI = 0x00000010;
27     public static final int LPD_SUPPORT_OPENGL = 0x00000020;
28     public static final int LPD_SHARE_DEPTH = 0x00000040;
29     public static final int LPD_SHARE_STENCIL = 0x00000080;
30     public static final int LPD_SHARE_ACCUM = 0x00000100;
31     public static final int LPD_SWAP_EXCHANGE = 0x00000200;
32     public static final int LPD_SWAP_COPY = 0x00000400;
33     public static final int LPD_TRANSPARENT = 0x00001000;
34     
35     public static final int LPD_TYPE_RGBA = 0;
36     public static final int LPD_TYPE_COLORINDEX = 1;
37     
38     /* wglSwapLayerBuffers flags */
39     public static final int WGL_SWAP_MAIN_PLANE = 0x00000001;
40     public static final int WGL_SWAP_OVERLAY1 = 0x00000002;
41     public static final int WGL_SWAP_OVERLAY2 = 0x00000004;
42     public static final int WGL_SWAP_OVERLAY3 = 0x00000008;
43     public static final int WGL_SWAP_OVERLAY4 = 0x00000010;
44     public static final int WGL_SWAP_OVERLAY5 = 0x00000020;
45     public static final int WGL_SWAP_OVERLAY6 = 0x00000040;
46     public static final int WGL_SWAP_OVERLAY7 = 0x00000080;
47     public static final int WGL_SWAP_OVERLAY8 = 0x00000100;
48     public static final int WGL_SWAP_OVERLAY9 = 0x00000200;
49     public static final int WGL_SWAP_OVERLAY10 = 0x00000400;
50     public static final int WGL_SWAP_OVERLAY11 = 0x00000800;
51     public static final int WGL_SWAP_OVERLAY12 = 0x00001000;
52     public static final int WGL_SWAP_OVERLAY13 = 0x00002000;
53     public static final int WGL_SWAP_OVERLAY14 = 0x00004000;
54     public static final int WGL_SWAP_OVERLAY15 = 0x00008000;
55     public static final int WGL_SWAP_UNDERLAY1 = 0x00010000;
56     public static final int WGL_SWAP_UNDERLAY2 = 0x00020000;
57     public static final int WGL_SWAP_UNDERLAY3 = 0x00040000;
58     public static final int WGL_SWAP_UNDERLAY4 = 0x00080000;
59     public static final int WGL_SWAP_UNDERLAY5 = 0x00100000;
60     public static final int WGL_SWAP_UNDERLAY6 = 0x00200000;
61     public static final int WGL_SWAP_UNDERLAY7 = 0x00400000;
62     public static final int WGL_SWAP_UNDERLAY8 = 0x00800000;
63     public static final int WGL_SWAP_UNDERLAY9 = 0x01000000;
64     public static final int WGL_SWAP_UNDERLAY10 = 0x02000000;
65     public static final int WGL_SWAP_UNDERLAY11 = 0x04000000;
66     public static final int WGL_SWAP_UNDERLAY12 = 0x08000000;
67     public static final int WGL_SWAP_UNDERLAY13 = 0x10000000;
68     public static final int WGL_SWAP_UNDERLAY14 = 0x20000000;
69     public static final int WGL_SWAP_UNDERLAY15 = 0x40000000;
70     
71     /* pixel types */
72     public static final int PFD_TYPE_RGBA = 0;
73     public static final int PFD_TYPE_COLORINDEX = 1;
74     
75     /* layer types */
76     public static final int PFD_MAIN_PLANE = 0;
77     public static final int PFD_OVERLAY_PLANE = 1;
78     public static final int PFD_UNDERLAY_PLANE = (-1);
79     
80     /* PIXELFORMATDESCRIPTOR flags */
81     public static final int PFD_DOUBLEBUFFER = 0x00000001;
82     public static final int PFD_STEREO = 0x00000002;
83     public static final int PFD_DRAW_TO_WINDOW = 0x00000004;
84     public static final int PFD_DRAW_TO_BITMAP = 0x00000008;
85     public static final int PFD_SUPPORT_GDI = 0x00000010;
86     public static final int PFD_SUPPORT_OPENGL = 0x00000020;
87     public static final int PFD_GENERIC_FORMAT = 0x00000040;
88     public static final int PFD_NEED_PALETTE = 0x00000080;
89     public static final int PFD_NEED_SYSTEM_PALETTE = 0x00000100;
90     public static final int PFD_SWAP_EXCHANGE = 0x00000200;
91     public static final int PFD_SWAP_COPY = 0x00000400;
92     public static final int PFD_SWAP_LAYER_BUFFERS = 0x00000800;
93     public static final int PFD_GENERIC_ACCELERATED = 0x00001000;
94     public static final int PFD_SUPPORT_DIRECTDRAW = 0x00002000;
95     
96     /* PIXELFORMATDESCRIPTOR flags for use in ChoosePixelFormat only */
97     public static final int PFD_DEPTH_DONTCARE = 0x20000000;
98     public static final int PFD_DOUBLEBUFFER_DONTCARE = 0x40000000;
99     public static final int PFD_STEREO_DONTCARE = 0x80000000;
100
101 public static final native int ChoosePixelFormat(int hdc, PIXELFORMATDESCRIPTOR ppfd);
102 public static final native int DescribePixelFormat(int hdc, int iPixelFormat, int nBytes, PIXELFORMATDESCRIPTOR ppfd);
103 public static final native int GetPixelFormat(int hdc);
104 public static final native boolean SetPixelFormat(int hdc, int iPixelFormat, PIXELFORMATDESCRIPTOR ppfd);
105 public static final native boolean SwapBuffers(int hdc);
106 public static final native boolean wglCopyContext(int hglrcSrc, int hglrcDst, int mask);
107 public static final native int wglCreateContext(int hdc);
108 public static final native int wglCreateLayerContext(int hdc, int iLayerPlane);
109 public static final native boolean wglDeleteContext(int hglrc);
110 public static final native int wglGetCurrentContext();
111 public static final native int wglGetCurrentDC();
112 public static final native int wglGetProcAddress(byte[] lpszProc);
113 public static final native boolean wglMakeCurrent(int hdc, int hglrc);
114 public static final native boolean wglShareLists(int hglrc1, int hglrc2);
115 public static final native boolean wglDescribeLayerPlane(int hdc, int iPixelFormat, int iLayerPlane, int nBytes, LAYERPLANEDESCRIPTOR plpd);
116 public static final native int wglSetLayerPaletteEntries(int hdc, int iLayerPlane, int iStart, int cEntries, int[] pcr);
117 public static final native int wglGetLayerPaletteEntries(int hdc, int iLayerPlane, int iStart, int cEntries, int[] pcr);
118 public static final native boolean wglRealizeLayerPalette(int hdc, int iLayerPlane, boolean bRealize);
119 public static final native boolean wglSwapLayerBuffers(int hdc, int fuPlanes);
120 }
121
Popular Tags