aboutsummaryrefslogtreecommitdiffstats
path: root/make/config/jogl/wgl-CustomCCode.c
diff options
context:
space:
mode:
authorSven Gothel <[email protected]>2009-03-16 14:38:27 +0000
committerSven Gothel <[email protected]>2009-03-16 14:38:27 +0000
commit24fcece997ba911b0270033a357bbd83258d4f1a (patch)
tree4d01034154734897724d6a3b7738bf22693a8d36 /make/config/jogl/wgl-CustomCCode.c
parent9517d52c18bfa93d78e03f4c212757eda421afb6 (diff)
JOGL refactoring:
Refactored JOGL into 3 independent components. 1 NWI - Native windowing interface Abstracts the the general NativeWindow interface and it's factory, incl the basic JAWT and Xlib toolkit. The latter was motivated to clean up the JOGL workspace, and to allow other to reuse this part. The generic core is nwi.core.jar, the AWT add-on is nwi.awt.jar. 2 JOGL - The OpenGL mapping Further cleanup of the SPEC. All non OpenGL toolkits are relocated to NWI and NEWT. There is still openmax and the windows audio layer .. Another cleanup of the fixed function pipeline emulation. Moved utilities and implementations where they belong .. Removed GLUnsupportedException. Misc .. changes 3 NEWT - The new windowing toolkit The generic NEWT, newt.core.jar. The JOGL and AWT modules are seperate, newt.ogl.jar newt.awt.jar. Their build can be switched off. The modules source and builds resides in their own directory. Because of their nature, they share the stub_includes, etc. Each module has it's own ant build script - build-nwi.xml - build-jogl.xml - build-newt.xml They can be build at once using build.xml as ususal, which just invokes the seperate build tasks. if rootrel.build=build, then the build location is jogl/build-nwi jogl/build-jogl jogl/build-newt and the sources are under jogl/src/nwi jogl/src/jogl jogl/src/newt Tested: jogl-demos, d4; Linux, MacOsX; Nvidia git-svn-id: file:///usr/local/projects/SUN/JOGL/git-svn/svn-server-sync/jogl/branches/JOGL_2_SANDBOX@1868 232f8b59-042b-4e1e-8c03-345bb8c30851
Diffstat (limited to 'make/config/jogl/wgl-CustomCCode.c')
-rwxr-xr-xmake/config/jogl/wgl-CustomCCode.c48
1 files changed, 48 insertions, 0 deletions
diff --git a/make/config/jogl/wgl-CustomCCode.c b/make/config/jogl/wgl-CustomCCode.c
new file mode 100755
index 000000000..0fe9ee628
--- /dev/null
+++ b/make/config/jogl/wgl-CustomCCode.c
@@ -0,0 +1,48 @@
+#include <stdio.h>
+
+#define JOGL_DUMMY_WINDOW_NAME "__jogl_dummy_window"
+
+LRESULT CALLBACK DummyWndProc( HWND hWnd, UINT uMsg, WPARAM wParam, LPARAM lParam) {
+ return DefWindowProc(hWnd,uMsg,wParam,lParam);
+}
+
+ATOM oglClass = 0;
+
+HWND CreateDummyWindow( int x, int y, int width, int height ) {
+ HINSTANCE hInstance;
+ DWORD dwExStyle;
+ DWORD dwStyle;
+ HWND hWnd;
+
+ hInstance = GetModuleHandle(NULL);
+ if( !oglClass ) {
+ WNDCLASS wc;
+ ZeroMemory( &wc, sizeof( wc ) );
+ wc.style = CS_HREDRAW | CS_VREDRAW | CS_OWNDC;
+ wc.lpfnWndProc = (WNDPROC) DummyWndProc;
+ wc.cbClsExtra = 0;
+ wc.cbWndExtra = 0;
+ wc.hInstance = hInstance;
+ wc.hIcon = NULL;
+ wc.hCursor = NULL;
+ wc.hbrBackground = NULL;
+ wc.lpszMenuName = NULL;
+ wc.lpszClassName = JOGL_DUMMY_WINDOW_NAME;
+ if( !(oglClass = RegisterClass( &wc )) ) {
+ printf( "RegisterClass Failed: %d\n", GetLastError() );
+ return( 0 );
+ }
+ }
+
+ dwExStyle = WS_EX_APPWINDOW | WS_EX_WINDOWEDGE;
+ dwStyle = WS_OVERLAPPEDWINDOW;
+ if( !(hWnd=CreateWindowEx( dwExStyle,
+ JOGL_DUMMY_WINDOW_NAME,
+ JOGL_DUMMY_WINDOW_NAME,
+ dwStyle | WS_CLIPSIBLINGS | WS_CLIPCHILDREN,
+ x, y, width, height,
+ NULL, NULL, hInstance, NULL ) ) ) {
+ return( 0 );
+ }
+ return( hWnd );
+}