[jogl~jogl-git:eab82899] X11 Display Lock completed (hope so)
- From: svengothel@kenai.com
- To: commits@jogl.kenai.com
- Subject: [jogl~jogl-git:eab82899] X11 Display Lock completed (hope so)
- Date: Tue, 13 Oct 2009 01:04:48 +0000
Project: jogl
Repository: jogl-git
Revision: eab82899e93c0f72df6c7f4bfba5ad252a36013e
Author: svengothel
Date: 2009-10-12 09:07:44 UTC
Link:
Log Message:
------------
Let the GLCapabilityChooser run over the fallback fixed GLCapabilities [last
resort]
test ..
Adding missing GL 3.0 reuse tokens ; Thanks to Koen Van den dries
Fix MacOSX External GLContext
Merge branch 'master' of ssh://jausoft.com/srv/scm/jogl
Oops .. fixed compile error
NEWT: Fix X11 ConfigureEvent ; X11Window don't propagate pos change if
parented
NativeWindowFactory:
- If property 'nativewindow.ws.name' is set,
use it as the custom windowing type returned by
getNativeWindowType(true)
NEWT:
- Using NativeWindowFactory's property 'nativewindow.ws.name'
as a package name for custom NEWT windowing imlementations,
ie:
-Dnativewindow.ws.name=com.sun.javafx.newt.intel.gdl
-Dnativewindow.ws.name=com.sun.javafx.newt.broadcom.egl
This allows far more flexibility to add custom impl.
- Add Intel-GDL, define property 'useIntelGDL'
to build the native part.
Intel GDL is impl in the package 'com.sun.javafx.newt.intel.gdl'
JOGL:
- All impl. of 'createGLDrawable(..)', which were actually creating
onscreen drawable only, were renamed to 'createOnscreenDrawable(..)'.
- GLDrawableFactoryImpl impl. 'createGLDrawable(..)' now
and dispatches to the actual create* methods in respect to
the Capabilities, ie onscreen, pbuffer and offscreen.
- GLDrawableFactory:
- If using a native ES profile -> EGLDrawableFactory
- If existing native OS factory -> Use that ..
- Else -> Use EGLDrawableFactory, if available
Allow custom user gluegen.compiler.xml ; NEWT: Example
lib/gluegen.compiler.intelgdl.xml
NEWT Intel GDL: Surface Size tuning .. ; Add missing getSurfaceHandle()
NEWT Intel GDL: Proper Pos/Size/Fullscreen
Proper PBuffer drawable abstraction
Pbuffer GLDrawableFactory integration (2)
NEWT: Offscreen integration
Offscreen/PBuffer capabilities cleanup ; Generic read drawable support
EGL debug fixes ..
EGL Fix: Use the surface handle for creation, not the window handle; More
fixedCaps.
surfaceupdated:: NativeWindow: passing 'updater'; NEWT: adding event listener
NativeWindow extends SurfaceUpdatedListener for 'surfaceUpdated' propagation.
GLDrawableFactory.createGLDrawable() propagates NativeWindow to offscreen
NullWindow.
Avoid NPE if no context current
Texture: Relax/Pending creation of texture ID, no context must be current
Fix EGL SurfaceType query/setup [on-/offscreen, pbuffer] using
EGLConfig/GLCapabilities
Fix Config: Set doublebuffer:=false if offscreen; NEWT: Fix KDWindow.
FIX: EGL Config: on-/offscreen and pbuffer; Added EGL-PBuffer setSurfaceHandle
EGLContext: Just debug lines ..
EGL: Use surfaceHandle, not windowHandle (2) for eglSurface
Add com.sun.opengl.util.texture.spi.NetPbmTextureWriter
GLDrawableFactory Cleanup (-> On- Offscreen and PBuffer)
- Base all PBuffer/Offscreen GLDrawable creators on
a prev. created 'NativeWindow + SurfaceChangeable' instance.
Simplifies implementation path.
This also removes the almost cyclic referencing of
GLWindow -> OffscreenWindow
GLWindow -> Drawable -> NullWindow -> OffscreenWindow
Now it is just
GLWindow -> OffscreenWindow
GLWindow -> Drawable -> OffscreenWindow
- createGLDrawable() shall be used for all types now,
especially if you want to pass the offscreen NativeWindow
and benefit from the surfaceChangedListener etc ..
- Add public createOffscreenDrawable(..)
- EGLDrawable:
- Query surface only if not 0
- [re]create surface only if needed,
using 'ownEGL*' flag for destruction only.
Fix: EGL set doublebuffer:=false for offscreen
Fix On-/Offscreen and PBuffer.
Demos are working again:
demos.jrefract.JRefract
- X11, Win32, OSX
-Dsun.java2d.opengl=true demos.jrefract.JRefract
- X11, Win32
demos.readbuffer.Main [-GL2,-GL2ES1] -test 0 demos.es1.RedSquare
- X11, Win32, OSX, EGL
demos.readbuffer.Main [-GL2,-GL2ES1] -test [12] demos.es1.RedSquare
- X11, Win32
- OSX not, because of the missing feature of
attaching a read surface.
- EGL not, because the emulation I used didn't support
attaching a read surface. Emulation bug .. probably ..
MacOSXWindowSystemInterface.m createContext():
- Verify if passed surface handle _is_ a view,
now it could be a pbuffer etc .. handle as well.
Cleanup GLDrawableImpl.setRealized(boolean realized)
- Calls setRealizedImpl() (implementation) now,
and only if new stated differs ..
- setRealizedImpl() fixed for:
MacOSXPbufferCGLDrawable: recreate/destroy
WindowsOffscreenWGLDrawable: recreate/destroy
WindowsPbufferWGLDrawable: no-recreate/destroy
X11OffscreenGLXDrawable: recreate/destroy
X11PbufferGLXDrawable: recreate/destroy
WindowsWGLContext:
- wglMakeContextCurrent(): uses isFunctionAvailable ..
- create():
Uses WGL.MakeCurrent() and releases the created context,
due to unavailable MakeContextCurrent extensions
before updating the procaddress tables.
EGL more query config trials; Avoid NPE if no config is chosen
Work on test webstart deploy scripts ..
NEWT: Add EventDispatchThread (EDT) pattern.
Due to limitations on Windows,
we need to standardize the one thread for
- window creation, and
- event dispatching
This was already mentioned in the previous implementation
but while integrating into another threading model (Plugin3),
it turned out that manual managing the thread is too much of a burden.
NEWT now uses a EDT per Display and Thread as the default,
where Display creation, Window creation and event dispatching is 'pipelined'
into.
This can be switched off:
NewtFactory.setUseEDT(boolean onoff);
and queried via:
NewtFactory.useEDT();
Note this EDT impl. does not implicate a global lock or whatsoever.
The experimantal semantics of a current GL context
for input event dispatching is removed,
i.e. the GL context is no more made current for mouse/key listener.
This reduces the complexity and allows the proper impl. of
the external dispatch via EDT .. for example.
Removed:
GLWindow: setEventHandlerMode(int) .. etc
X11Display: XLockDisplay/XUnlockDisplay
needed to be utilized to allow the new
multithreading (EDT/Render) Display usage.
X11Window: lockSurface/unlockSurface
locks X11Display as well ..
+++++
NEWT: 'getSurfaceHandle()' semantics changed.
To allow usage of the surfaceHandle for OS
where it is allocated thread local (MS-Windows),
it shall be aquired/released while lockSurface/unlockSurface.
This is done in the Windows Window implementation.
GLWindow can no more query 'getSurfaceHandle()'
to verify if 'setRealized()' was successful.
NEWT: Window surface lock is recursive and blocking now,
as it shall be.
NEWT: Avoid NPE at destroy() ; DEBUG println ..
NEWT X11 Display Lock:
Integrate Display.lock/unlock,
so the generic Window will call it.
Specialized for X11Display, the only real impl of it.
Fixes offscreen EDT usage ..
GLProfile:
Add isAWTAvailable() and isAWTJOGLAvailable()
TextureIO:
- Add NetPbmTextureWriter
- Only use IIOTexture* if !isAWTJOGLAvailable()
- Add write (TextureData, File)
NativeWindow X11: Lock/Unlock Display if using it
X11 Display Lock completed (hope so)
- JOGL GLXUtil
- JOGL X11GLXDrawableFactory
- JOGL X11GLXGraphicsConfigurationFactory
- JOGL X11OffscreenGLXDrawable
- NW X11GraphicsConfigurationFactory
NEWT Display
- Stop EDT immediatly from within EDT when destroying
-
NEWT Window
- Remove obsolete 'disposeSurfaceHandle()'
NEWT GLWindow destroy():
- Deep destruction (Window, Screen and Display) if owner,
otherwise just the GLWindow/GLDrawable
- Add 'sendDisposeEvent' flag, to allow avoiding sending
dispose to all GLEventListeners in a critical shutdown,
ie from within the browser.
NEWT EDT
- More fine grained locking
- unlocked while event dispatching
- double check locking
- Fixed cases where we are running on the EDT ..
Revisions:
----------
887b14710c5b358b5c6deb5745e141ad099bb60c
2c5bf51f0f9555729d7727fe30d92cb383dc6922
82ff74cfca31c3c72d9c1de260c17323943fa571
760d6821e09985252c8b439d9a92bead7bcf1193
2a9436485393366847907e84adeb6ddb19da4226
079c94b7a0b64bc6a77abdfd4377262e75159478
cd45d13bbd0ff1da3dac678a6461b5fdce2783c1
9fd3c095ce2117c3cb67169c97531cac78ab04c4
966fc409d440f6c4d0ff9dab38f0f83ada36735f
56cc5d5058f352d0a46679b67d4f6650e457cbb9
52c3caf07ad07fcb029ea584d7e5f4c5031f84c2
8fb68690f20eece763561f6f0038a007e934a1dc
d3a4046f5c45b8ef6e6f70115fcf6250e09a8732
1304fcd939bea7ea804d2fef22a942848b02a20b
cf4c403733363a0e0e06079d85ddae91399696ab
f043a48504b79409df4e674a15c87faa3f47c03f
907c249a5a6f80d10912440aa073ba42b94ae6de
4d4b7c52d032d0c9302e4e16560f2e874e31b8bc
bf584fba26561a1905f37251d681ac100d4a0779
675ee156d70463f25c766e13547e0c22f19e3eac
14a2ea2a7eb093ff3fb5322ace1a6f8767401f3d
5cd7e4fab47996eddf1a2798215fb975fe32b4bf
012460d1fdef767afdc454fb09ba50f056d26e20
dae3705d5b8bee0a2ae0a809632f2c6d607f6c30
a8db29bae61bbaf4726ebf254cc510abbdb311f8
4edde96746fca6e2f7c35bcd54312e43a16443e6
59257476777104ff3f117d87a8205161cb800abf
76bf2e5a7f23def0a3bf2b688791b593ecb283ab
906e3698f1493daab5cf196b893e65b11b2f0d12
62fb860ffc454fc00ed73f9b6da54bba34a6d64f
e8fbf3c0738c39005036c50e74dd20e4956f372f
20c6d89bfc4f72144b8bcc48839da7ef9bc40681
2268a6ce8a900ae7aa9f20d5f595f811185574a9
6f6436ab9c7345f4d3b7bf5d8ee70addc9f11ab0
8f76db4364f66c36780e762e086a18d5cc315363
7a2103506ba9e570737da6af4e156c3bf06fe765
eab82899e93c0f72df6c7f4bfba5ad252a36013e
Modified Paths:
---------------
README.txt
src/jogl/classes/com/sun/opengl/impl/egl/EGLGraphicsConfigurationFactory.java
make/stub_includes/opengl/GL3/gl3.h
make/build-jogl.xml
make/stub_includes/macosx/OpenGL/OpenGL.h
make/stub_includes/opengl/macosx-window-system.h
src/jogl/classes/com/sun/opengl/impl/macosx/cgl/MacOSXCGLContext.java
src/jogl/classes/com/sun/opengl/impl/macosx/cgl/MacOSXCGLDrawableFactory.java
src/jogl/classes/com/sun/opengl/impl/macosx/cgl/MacOSXCGLGraphicsConfiguration.java
src/jogl/classes/com/sun/opengl/impl/macosx/cgl/MacOSXCGLGraphicsConfigurationFactory.java
src/jogl/classes/com/sun/opengl/impl/macosx/cgl/MacOSXExternalCGLContext.java
src/jogl/classes/com/sun/opengl/impl/x11/glx/X11ExternalGLXContext.java
src/jogl/native/macosx/MacOSXWindowSystemInterface.m
src/jogl/classes/com/sun/opengl/impl/macosx/cgl/MacOSXPbufferCGLDrawable.java
src/newt/classes/com/sun/javafx/newt/x11/X11Window.java
src/newt/native/X11Window.c
make/build-newt.xml
src/jogl/classes/com/sun/opengl/impl/GLDrawableFactoryImpl.java
src/jogl/classes/com/sun/opengl/impl/egl/EGLDrawable.java
src/jogl/classes/com/sun/opengl/impl/egl/EGLDrawableFactory.java
src/jogl/classes/com/sun/opengl/impl/windows/wgl/WindowsWGLDrawableFactory.java
src/jogl/classes/com/sun/opengl/impl/x11/glx/X11GLXDrawableFactory.java
src/jogl/classes/javax/media/opengl/GLDrawableFactory.java
src/nativewindow/classes/javax/media/nativewindow/NativeWindowFactory.java
src/newt/classes/com/sun/javafx/newt/Display.java
src/newt/classes/com/sun/javafx/newt/NewtFactory.java
src/newt/classes/com/sun/javafx/newt/Screen.java
src/newt/classes/com/sun/javafx/newt/Window.java
src/newt/native/BroadcomEGL.c
make/build-nativewindow.xml
src/newt/classes/com/sun/javafx/newt/intel/gdl/Window.java
src/newt/native/IntelGDL.c
src/jogl/classes/com/sun/opengl/impl/GLPbufferImpl.java
src/jogl/classes/com/sun/opengl/impl/GLContextImpl.java
src/jogl/classes/com/sun/opengl/impl/GLDrawableImpl.java
src/jogl/classes/com/sun/opengl/impl/egl/EGLContext.java
src/jogl/classes/com/sun/opengl/impl/egl/EGLGraphicsConfiguration.java
src/jogl/classes/com/sun/opengl/impl/egl/EGLPbufferDrawable.java
src/jogl/classes/com/sun/opengl/impl/windows/wgl/WindowsOffscreenWGLDrawable.java
src/jogl/classes/com/sun/opengl/impl/windows/wgl/WindowsPbufferWGLDrawable.java
src/jogl/classes/com/sun/opengl/impl/windows/wgl/WindowsWGLContext.java
src/jogl/classes/com/sun/opengl/impl/windows/wgl/WindowsWGLGraphicsConfigurationFactory.java
src/jogl/classes/com/sun/opengl/impl/x11/glx/X11GLXContext.java
src/jogl/classes/com/sun/opengl/impl/x11/glx/X11GLXGraphicsConfigurationFactory.java
src/jogl/classes/com/sun/opengl/impl/x11/glx/X11OffscreenGLXDrawable.java
src/jogl/classes/com/sun/opengl/impl/x11/glx/X11PbufferGLXDrawable.java
src/jogl/classes/javax/media/opengl/GLContext.java
src/newt/classes/com/sun/javafx/newt/opengl/GLWindow.java
src/jogl/classes/javax/media/opengl/DefaultGLCapabilitiesChooser.java
src/jogl/classes/com/sun/opengl/impl/egl/EGLOnscreenDrawable.java
src/nativewindow/classes/com/sun/nativewindow/impl/NullWindow.java
src/nativewindow/classes/com/sun/nativewindow/impl/jawt/JAWTWindow.java
src/nativewindow/classes/javax/media/nativewindow/NativeWindow.java
src/newt/classes/com/sun/javafx/newt/EventListener.java
src/jogl/classes/com/sun/opengl/util/texture/Texture.java
src/newt/classes/com/sun/javafx/newt/opengl/kd/KDWindow.java
src/jogl/classes/com/sun/opengl/impl/macosx/cgl/MacOSXOffscreenCGLDrawable.java
src/jogl/classes/javax/media/opengl/awt/GLJPanel.java
src/newt/classes/com/sun/javafx/newt/OffscreenWindow.java
src/jogl/classes/com/sun/opengl/impl/macosx/cgl/MacOSXCGLDrawable.java
src/jogl/classes/com/sun/opengl/impl/windows/wgl/WindowsWGLDrawable.java
src/jogl/classes/com/sun/opengl/impl/x11/glx/X11GLXDrawable.java
src/jogl/classes/com/sun/opengl/impl/egl/EGLDynamicLookupHelper.java
src/jogl/classes/com/sun/opengl/impl/windows/wgl/WindowsWGLGraphicsConfiguration.java
src/jogl/classes/com/sun/opengl/impl/x11/glx/X11GLXGraphicsConfiguration.java
src/nativewindow/classes/javax/media/nativewindow/DefaultGraphicsConfiguration.java
make/deploy-jars-webstarttest.sh
make/deploy-jnlp-webstarttest.sh
make/stub_includes/x11/window-lib.c
src/jogl/classes/com/sun/opengl/util/Animator.java
src/newt/classes/com/sun/javafx/newt/Event.java
src/newt/classes/com/sun/javafx/newt/KeyEvent.java
src/newt/classes/com/sun/javafx/newt/opengl/broadcom/egl/Window.java
src/newt/classes/com/sun/javafx/newt/windows/WindowsWindow.java
src/newt/classes/com/sun/javafx/newt/x11/X11Display.java
src/newt/native/WindowsWindow.c
src/newt/classes/com/sun/javafx/newt/util/EventDispatchThread.java
src/jogl/classes/com/sun/opengl/impl/x11/glx/X11OnscreenGLXContext.java
src/jogl/classes/com/sun/opengl/util/texture/TextureIO.java.javame_cdc_fp
src/jogl/classes/com/sun/opengl/util/texture/TextureIO.java.javase
src/jogl/classes/com/sun/opengl/util/texture/spi/NetPbmTextureWriter.java
src/jogl/classes/javax/media/opengl/GLProfile.java
src/nativewindow/classes/javax/media/nativewindow/x11/X11GraphicsScreen.java
src/jogl/classes/com/sun/opengl/impl/x11/glx/GLXUtil.java
src/nativewindow/classes/com/sun/nativewindow/impl/x11/X11GraphicsConfigurationFactory.java
Added Paths:
------------
REPOSITORIES.txt
src/jogl/native/macosx/MacOSXCustomCGLCode.c
make/stub_includes/embedded/IntelGDL/gdl.h
make/stub_includes/embedded/IntelGDL/gdl_pd.h
make/stub_includes/embedded/IntelGDL/gdl_types.h
make/stub_includes/embedded/IntelGDL/gdl_version.h
src/newt/classes/com/sun/javafx/newt/intel/gdl/Display.java
src/newt/classes/com/sun/javafx/newt/intel/gdl/Screen.java
src/newt/classes/com/sun/javafx/newt/intel/gdl/Window.java
src/newt/classes/com/sun/javafx/newt/opengl/broadcom/egl/Display.java
src/newt/classes/com/sun/javafx/newt/opengl/broadcom/egl/Screen.java
src/newt/classes/com/sun/javafx/newt/opengl/broadcom/egl/Window.java
src/newt/native/IntelGDL.c
make/lib/gluegen.compiler.intelgdl.xml
src/newt/classes/com/sun/javafx/newt/OffscreenWindow.java
src/newt/classes/com/sun/javafx/newt/SurfaceUpdatedListener.java
src/nativewindow/classes/javax/media/nativewindow/SurfaceUpdatedListener.java
src/jogl/classes/com/sun/opengl/util/texture/spi/NetPbmTextureWriter.java
src/nativewindow/classes/javax/media/nativewindow/SurfaceChangeable.java
make/deploy-jars-webstarttest_pack200.sh
src/newt/classes/com/sun/javafx/newt/util/EventDispatchThread.java
Diffs:
------
diff --git a/README.txt b/README.txt
index 924f6e4..efb7eb4 100755
--- a/README.txt
+++ b/README.txt
@@ -36,7 +36,7 @@ Pepijn Van Eeckhoudt and Nathan Parker Burg contributed the
Java port
of the GLU tessellator. Pepijn also contributed the initial version of
the FPSAnimator utility class.
-User GKW on the javagaming.org forums contributed the substantial port
+James Walsh (GKW) contributed the substantial port
of the GLU mipmap generation code to Java, as well as robustness fixes
in the Windows implementation and other areas.
diff --git
a/src/jogl/classes/com/sun/opengl/impl/egl/EGLGraphicsConfigurationFactory.java
b/src/jogl/classes/com/sun/opengl/impl/egl/EGLGraphicsConfigurationFactory.java
index e0a025c..d05f10e 100644
---
a/src/jogl/classes/com/sun/opengl/impl/egl/EGLGraphicsConfigurationFactory.java
+++
b/src/jogl/classes/com/sun/opengl/impl/egl/EGLGraphicsConfigurationFactory.java
@@ -146,13 +146,24 @@ public class EGLGraphicsConfigurationFactory extends
GraphicsConfigurationFactor
fixedCaps.setGreenBits(6);
fixedCaps.setBlueBits(5);
fixedCaps.setDepthBits(16);
+ /**
fixedCaps.setSampleBuffers(true);
- fixedCaps.setNumSamples(4);
+ fixedCaps.setNumSamples(4); */
if(DEBUG) {
System.err.println("trying fixed caps: "+fixedCaps);
}
- res = eglChooseConfig(eglDisplay, fixedCaps, capabilities, chooser,
absScreen, eglSurfaceType);
+ chosen = -1;
+ try {
+ chosen = chooser.chooseCapabilities(fixedCaps, caps, -1);
+ } catch (NativeWindowException e) { throw new GLException(e); }
+ if(chosen<0) {
+ throw new GLException("Graphics configuration chooser fixed
failed");
+ }
+ if(DEBUG) {
+ System.err.println("Choosen fixed "+caps[chosen]);
+ }
+ res = eglChooseConfig(eglDisplay, caps[chosen], capabilities,
chooser, absScreen, eglSurfaceType);
if(null==res) {
throw new GLException("Graphics configuration failed [direct
caps, eglGetConfig/chooser and fixed-caps]");
}
diff --git a/REPOSITORIES.txt b/REPOSITORIES.txt
new file mode 100644
index 0000000..fafd453
--- /dev/null
+++ b/REPOSITORIES.txt
@@ -0,0 +1 @@
+test ..
diff --git a/make/stub_includes/opengl/GL3/gl3.h
b/make/stub_includes/opengl/GL3/gl3.h
index 7db3851..437830d 100755
--- a/make/stub_includes/opengl/GL3/gl3.h
+++ b/make/stub_includes/opengl/GL3/gl3.h
@@ -1067,6 +1067,52 @@ typedef void GLvoid;
#define GL_COPY_WRITE_BUFFER 0x8F37
#endif
+#ifndef GL_ARB_depth_buffer_float
+#define GL_DEPTH_COMPONENT32F 0x8CAC
+#define GL_DEPTH32F_STENCIL8 0x8CAD
+#define GL_FLOAT_32_UNSIGNED_INT_24_8_REV 0x8DAD
+#endif
+
+#ifndef GL_ARB_framebuffer_sRGB
+#define GL_FRAMEBUFFER_SRGB 0x8DB9
+#endif
+
+#ifndef GL_ARB_half_float_pixel
+#define GL_HALF_FLOAT_ARB 0x140B
+#endif
+
+#ifndef GL_ARB_texture_compression_rgtc
+#define GL_COMPRESSED_RED_RGTC1 0x8DBB
+#define GL_COMPRESSED_SIGNED_RED_RGTC1 0x8DBC
+#define GL_COMPRESSED_RG_RGTC2 0x8DBD
+#define GL_COMPRESSED_SIGNED_RG_RGTC2 0x8DBE
+#endif
+
+#ifndef GL_ARB_texture_rg
+#define GL_RG 0x8227
+#define GL_RG_INTEGER 0x8228
+#define GL_R8 0x8229
+#define GL_R16 0x822A
+#define GL_RG8 0x822B
+#define GL_RG16 0x822C
+#define GL_R16F 0x822D
+#define GL_R32F 0x822E
+#define GL_RG16F 0x822F
+#define GL_RG32F 0x8230
+#define GL_R8I 0x8231
+#define GL_R8UI 0x8232
+#define GL_R16I 0x8233
+#define GL_R16UI 0x8234
+#define GL_R32I 0x8235
+#define GL_R32UI 0x8236
+#define GL_RG8I 0x8237
+#define GL_RG8UI 0x8238
+#define GL_RG16I 0x8239
+#define GL_RG16UI 0x823A
+#define GL_RG32I 0x823B
+#define GL_RG32UI 0x823C
+#endif
+
/*************************************************************/
diff --git a/make/build-jogl.xml b/make/build-jogl.xml
index c541748..64e5cf9 100644
--- a/make/build-jogl.xml
+++ b/make/build-jogl.xml
@@ -1408,6 +1408,7 @@
<condition property="c.compiler.use-debug"><istrue
value="${c.compiler.debug}"/></condition>
<patternset id="c.src.files.jogl.gl2">
+ <include name="${rootrel.src.c}/macosx/MacOSXCustomCGLCode.c"
if="isOSX"/>
<include
name="${rootrel.src.c}/macosx/MacOSXWindowSystemInterface.m" if="isOSX"/>
<include name="${rootrel.src.c}/macosx/ContextUpdater.m"
if="isOSX"/>
<include name="${rootrel.src.c}/GLXGetProcAddressARB.c"
if="isX11"/>
@@ -1426,6 +1427,7 @@
</patternset>
<patternset id="c.src.files.jogl.gl2es12">
+ <include name="${rootrel.src.c}/macosx/MacOSXCustomCGLCode.c"
if="isOSX"/>
<include
name="${rootrel.src.c}/macosx/MacOSXWindowSystemInterface.m" if="isOSX"/>
<include name="${rootrel.src.c}/macosx/ContextUpdater.m"
if="isOSX"/>
<include name="${rootrel.src.c}/GLXGetProcAddressARB.c"
if="isX11"/>
diff --git a/make/stub_includes/macosx/OpenGL/OpenGL.h
b/make/stub_includes/macosx/OpenGL/OpenGL.h
index 16225b4..afb11ef 100644
--- a/make/stub_includes/macosx/OpenGL/OpenGL.h
+++ b/make/stub_includes/macosx/OpenGL/OpenGL.h
@@ -73,18 +73,44 @@ typedef enum _CGLError {
kCGLBadConnection = 10017 /* invalid CoreGraphics connection */
} CGLError;
+typedef enum _CGLContextParameter {
+ kCGLCPSwapRectangle = 200,
+ kCGLCPSwapInterval = 222,
+ kCGLCPDispatchTableSize = 224,
+ kCGLCPClientStorage = 226,
+ kCGLCPSurfaceTexture = 228,
+ kCGLCPSurfaceOrder = 235,
+ kCGLCPSurfaceOpacity = 236,
+ kCGLCPSurfaceBackingSize = 304,
+ kCGLCPSurfaceSurfaceVolatile = 306,
+ kCGLCPReclaimResources = 308,
+ kCGLCPCurrentRendererID = 309,
+ kCGLCPGPUVertexProcessing = 310,
+ kCGLCPGPUFragmentProcessing = 311,
+ kCGLCPHasDrawable = 314,
+ kCGLCPMPSwapsInFlight = 315,
+} CGLContextParameter;
+
/* Pixel format manipulation */
CGLError CGLChoosePixelFormat(const CGLPixelFormatAttribute *attribs,
CGLPixelFormatObj *pix,
long *npix);
CGLError CGLDestroyPixelFormat(CGLPixelFormatObj pix);
+CGLPixelFormatObj CGLGetPixelFormat ( CGLContextObj ctx );
/* Context manipulation */
CGLError CGLCreateContext(CGLPixelFormatObj pix,
CGLContextObj share,
CGLContextObj* ctx);
+void CGLReleaseContext(CGLContextObj ctx);
CGLError CGLDestroyContext(CGLContextObj ctx);
CGLError CGLSetCurrentContext(CGLContextObj ctx);
+CGLContextObj CGLGetCurrentContext (void);
+CGLError CGLFlushDrawable ( CGLContextObj ctx);
+CGLError CGLSetParameter ( CGLContextObj ctx, CGLContextParameter pname,
const int *params );
+CGLError CGLCopyContext ( CGLContextObj src, CGLContextObj dst, int mask );
+
+
/* PBuffer manipulation */
CGLError CGLCreatePBuffer(long width,
diff --git a/make/stub_includes/opengl/macosx-window-system.h
b/make/stub_includes/opengl/macosx-window-system.h
index f43adb5..7d2704b 100644
--- a/make/stub_includes/opengl/macosx-window-system.h
+++ b/make/stub_includes/opengl/macosx-window-system.h
@@ -9,27 +9,36 @@
typedef int Bool;
+// CGL ..
+void CGLQueryPixelFormat(void* pixelFormat, int* iattrs, int niattrs, int*
ivalues);
+
+// NS ..
void* createPixelFormat(int* iattrs, int niattrs, int* ivalues);
void queryPixelFormat(void* pixelFormat, int* iattrs, int niattrs, int*
ivalues);
void deletePixelFormat(void* pixelFormat);
+// NS ..
+void *getCurrentContext(void);
+void *getNSView(void* nsContext);
+
void* createContext(void* shareContext,
void* nsView,
void* pixelFormat,
int* viewNotReady);
+void *getCGLContext(void* nsContext);
Bool makeCurrentContext(void* nsContext);
-Bool clearCurrentContext(void* nsContext);
+Bool clearCurrentContext(void *nsContext);
Bool deleteContext(void* nsContext);
Bool flushBuffer(void* nsContext);
-void setContextOpacity(void* context, int opacity);
+void setContextOpacity(void* nsContext, int opacity);
void updateContext(void* nsContext);
void copyContext(void* destContext, void* srcContext, int mask);
void* updateContextRegister(void* nsContext, void* nsView);
-void updateContextUnregister(void* nsContext, void* nsView, void* updater);
+void updateContextUnregister(void* updater);
void* createPBuffer(int renderTarget, int internalFormat, int width, int
height);
-Bool destroyPBuffer(void* nsContext, void* pBuffer);
+Bool destroyPBuffer(void* pBuffer);
void setContextPBuffer(void* nsContext, void* pBuffer);
void setContextTextureImageToPBuffer(void* nsContext, void* pBuffer, int
colorBuffer);
diff --git
a/src/jogl/classes/com/sun/opengl/impl/macosx/cgl/MacOSXCGLContext.java
b/src/jogl/classes/com/sun/opengl/impl/macosx/cgl/MacOSXCGLContext.java
index 181efc8..111b215 100644
--- a/src/jogl/classes/com/sun/opengl/impl/macosx/cgl/MacOSXCGLContext.java
+++ b/src/jogl/classes/com/sun/opengl/impl/macosx/cgl/MacOSXCGLContext.java
@@ -49,7 +49,8 @@ import com.sun.gluegen.runtime.ProcAddressTable;
public abstract class MacOSXCGLContext extends GLContextImpl
{
protected MacOSXCGLDrawable drawable;
- protected long nsContext; // NSOpenGLContext
+ protected long nsContext; // NSOpenGLContext
+ protected long cglContext; // CGLContextObj
private CGLExt cglExt;
// Table that holds the addresses of the native C-language entry points for
// CGL extension functions.
@@ -111,44 +112,23 @@ public abstract class MacOSXCGLContext extends
GLContextImpl
}
}
MacOSXCGLGraphicsConfiguration config = (MacOSXCGLGraphicsConfiguration)
drawable.getNativeWindow().getGraphicsConfiguration().getNativeGraphicsConfiguration();
- GLCapabilities capabilities =
(GLCapabilities)config.getRequestedCapabilities();
- GLProfile glProfile = capabilities.getGLProfile();
+ GLCapabilities capabilitiesRequested =
(GLCapabilities)config.getRequestedCapabilities();
+ GLProfile glProfile = capabilitiesRequested.getGLProfile();
if(glProfile.isGL3()) {
throw new GLException("GL3 profile currently not supported on
MacOSX, due to the lack of a OpenGL 3.1 implementation");
}
- // FIXME: Shall being moved to MacOSXCGLGraphicsConfiguration !
- int[] viewNotReady = new int[1];
- int[] iattribs = new int[128];
- int[] ivalues = new int[128];
- int idx = 0;
- if (pbuffer) {
- iattribs[idx] = CGL.NSOpenGLPFAPixelBuffer; ivalues[idx] = 1; idx++;
- }
- if (floatingPoint) {
- iattribs[idx] = CGL.kCGLPFAColorFloat; ivalues[idx] = 1; idx++;
- }
- iattribs[idx] = CGL.NSOpenGLPFADoubleBuffer; ivalues[idx] =
(capabilities.getDoubleBuffered() ? 1 : 0); idx++;
- iattribs[idx] = CGL.NSOpenGLPFAStereo; ivalues[idx] =
(capabilities.getStereo() ? 1 : 0); idx++;
- iattribs[idx] = CGL.NSOpenGLPFAColorSize; ivalues[idx] =
(capabilities.getRedBits() +
-
capabilities.getGreenBits() +
-
capabilities.getBlueBits()); idx++;
- iattribs[idx] = CGL.NSOpenGLPFAAlphaSize; ivalues[idx] =
capabilities.getAlphaBits(); idx++;
- iattribs[idx] = CGL.NSOpenGLPFADepthSize; ivalues[idx] =
capabilities.getDepthBits(); idx++;
- iattribs[idx] = CGL.NSOpenGLPFAAccumSize; ivalues[idx] =
(capabilities.getAccumRedBits() +
-
capabilities.getAccumGreenBits() +
-
capabilities.getAccumBlueBits() +
-
capabilities.getAccumAlphaBits()); idx++;
- iattribs[idx] = CGL.NSOpenGLPFAStencilSize; ivalues[idx] =
capabilities.getStencilBits(); idx++;
- if (capabilities.getSampleBuffers()) {
- iattribs[idx] = CGL.NSOpenGLPFASampleBuffers; ivalues[idx] = 1;
idx++;
- iattribs[idx] = CGL.NSOpenGLPFASamples; ivalues[idx] =
capabilities.getNumSamples(); idx++;
- }
+ // HACK .. bring in OnScreen/PBuffer selection to the DrawableFactory !!
+ GLCapabilities capabilities = (GLCapabilities)
capabilitiesRequested.clone();
+ capabilities.setPBuffer(pbuffer);
+ capabilities.setPbufferFloatingPointBuffers(floatingPoint);
- long pixelFormat = CGL.createPixelFormat(iattribs, 0, idx, ivalues, 0);
+ long pixelFormat =
MacOSXCGLGraphicsConfiguration.GLCapabilities2NSPixelFormat(capabilities);
if (pixelFormat == 0) {
throw new GLException("Unable to allocate pixel format with requested
GLCapabilities");
}
+ config.setChosenPixelFormat(pixelFormat);
try {
+ int[] viewNotReady = new int[1];
// Try to allocate a context with this
nsContext = CGL.createContext(share,
drawable.getNativeWindow().getSurfaceHandle(),
@@ -170,80 +150,8 @@ public abstract class MacOSXCGLContext extends
GLContextImpl
CGL.setContextOpacity(nsContext, 0);
}
- // On this platform the pixel format is associated with the
- // context and not the drawable. However it's a reasonable
- // approximation to just store the chosen pixel format up in the
- // NativeWindow's AbstractGraphicsConfiguration,
- // since the public API doesn't provide for a different GLCapabilities
per context.
- // Note: These restrictions of the platform's API might be considered
as a bug anyways.
- {
- // Figure out what attributes we really got
- GLCapabilities caps = new GLCapabilities(glProfile);
- CGL.queryPixelFormat(pixelFormat, iattribs, 0, idx, ivalues, 0);
- for (int i = 0; i < idx; i++) {
- int attr = iattribs[i];
- switch (attr) {
- case CGL.kCGLPFAColorFloat:
- caps.setPbufferFloatingPointBuffers(ivalues[i] != 0);
- break;
-
- case CGL.NSOpenGLPFADoubleBuffer:
- caps.setDoubleBuffered(ivalues[i] != 0);
- break;
-
- case CGL.NSOpenGLPFAStereo:
- caps.setStereo(ivalues[i] != 0);
- break;
-
- case CGL.NSOpenGLPFAColorSize:
- {
- int bitSize = ivalues[i];
- if (bitSize == 32)
- bitSize = 24;
- bitSize /= 3;
- caps.setRedBits(bitSize);
- caps.setGreenBits(bitSize);
- caps.setBlueBits(bitSize);
- }
- break;
-
- case CGL.NSOpenGLPFAAlphaSize:
- caps.setAlphaBits(ivalues[i]);
- break;
-
- case CGL.NSOpenGLPFADepthSize:
- caps.setDepthBits(ivalues[i]);
- break;
-
- case CGL.NSOpenGLPFAAccumSize:
- {
- int bitSize = ivalues[i] / 4;
- caps.setAccumRedBits(bitSize);
- caps.setAccumGreenBits(bitSize);
- caps.setAccumBlueBits(bitSize);
- caps.setAccumAlphaBits(bitSize);
- }
- break;
-
- case CGL.NSOpenGLPFAStencilSize:
- caps.setStencilBits(ivalues[i]);
- break;
-
- case CGL.NSOpenGLPFASampleBuffers:
- caps.setSampleBuffers(ivalues[i] != 0);
- break;
-
- case CGL.NSOpenGLPFASamples:
- caps.setNumSamples(ivalues[i]);
- break;
-
- default:
- break;
- }
- }
-
- config.setChosenCapabilities(caps);
- }
+ GLCapabilities caps =
MacOSXCGLGraphicsConfiguration.NSPixelFormat2GLCapabilities(glProfile,
pixelFormat);
+ config.setChosenCapabilities(caps);
} finally {
CGL.deletePixelFormat(pixelFormat);
}
@@ -256,14 +164,14 @@ public abstract class MacOSXCGLContext extends
GLContextImpl
}
protected int makeCurrentImpl() throws GLException {
- if (drawable.getNativeWindow().getSurfaceHandle() == 0) {
+ if (0 == cglContext && drawable.getNativeWindow().getSurfaceHandle() ==
0) {
if (DEBUG) {
System.err.println("drawable not properly initialized");
}
return CONTEXT_NOT_CURRENT;
}
boolean created = false;
- if (nsContext == 0) {
+ if ( 0 == cglContext && 0 == nsContext) {
if (!create()) {
return CONTEXT_NOT_CURRENT;
}
@@ -273,8 +181,14 @@ public abstract class MacOSXCGLContext extends
GLContextImpl
created = true;
}
- if (!CGL.makeCurrentContext(nsContext)) {
- throw new GLException("Error making nsContext current");
+ if ( 0 != cglContext ) {
+ if (CGL.kCGLNoError != CGL.CGLSetCurrentContext(cglContext)) {
+ throw new GLException("Error making cglContext current");
+ }
+ } else {
+ if (!CGL.makeCurrentContext(nsContext)) {
+ throw new GLException("Error making nsContext current");
+ }
}
if (created) {
@@ -285,38 +199,64 @@ public abstract class MacOSXCGLContext extends
GLContextImpl
}
protected void releaseImpl() throws GLException {
- if (!CGL.clearCurrentContext(nsContext)) {
- throw new GLException("Error freeing OpenGL nsContext");
+ if ( 0 != cglContext ) {
+ CGL.CGLReleaseContext(cglContext);
+ } else {
+ if (!CGL.clearCurrentContext(nsContext)) {
+ throw new GLException("Error freeing OpenGL nsContext");
+ }
}
}
protected void destroyImpl() throws GLException {
- if (nsContext != 0) {
+ boolean hadContext = isCreated();
+ if ( 0 != cglContext ) {
+ if (CGL.kCGLNoError != CGL.CGLDestroyContext(cglContext)) {
+ throw new GLException("Unable to delete OpenGL cglContext");
+ }
+ if (DEBUG) {
+ System.err.println("!!! Destroyed OpenGL cglContext " + cglContext);
+ }
+ cglContext = 0;
+ GLContextShareSet.contextDestroyed(this);
+ } else if ( 0 != nsContext ) {
if (!CGL.deleteContext(nsContext)) {
- throw new GLException("Unable to delete OpenGL context");
+ throw new GLException("Unable to delete OpenGL nsContext");
}
if (DEBUG) {
- System.err.println("!!! Destroyed OpenGL context " + nsContext);
+ System.err.println("!!! Destroyed OpenGL nsContext " + nsContext);
}
nsContext = 0;
+ }
+ if(hadContext) {
GLContextShareSet.contextDestroyed(this);
}
}
public boolean isCreated() {
- return (nsContext != 0);
+ return 0 != cglContext || 0 != nsContext ;
}
public void copy(GLContext source, int mask) throws GLException {
- long dst = getNSContext();
- long src = ((MacOSXCGLContext) source).getNSContext();
- if (src == 0) {
- throw new GLException("Source OpenGL context has not been created");
- }
- if (dst == 0) {
- throw new GLException("Destination OpenGL context has not been
created");
+ long dst = getCGLContext();
+ long src = 0;
+ if( 0 != dst ) {
+ src = ((MacOSXCGLContext) source).getCGLContext();
+ if (src == 0) {
+ throw new GLException("Source OpenGL cglContext has not been
created ; Destination has a cglContext.");
+ }
+ CGL.CGLCopyContext(src, dst, mask);
+ } else {
+ dst = getNSContext();
+ src = ((MacOSXCGLContext) source).getNSContext();
+ if (src == 0) {
+ throw new GLException("Source OpenGL nsContext has not been
created");
+ }
+ if (dst == 0) {
+ throw new GLException("Destination OpenGL nsContext has not been
created");
+ }
+ CGL.copyContext(dst, src, mask);
}
- CGL.copyContext(dst, src, mask);
}
protected void updateGLProcAddressTable() {
@@ -338,10 +278,14 @@ public abstract class MacOSXCGLContext extends
GLContextImpl
}
protected void setSwapIntervalImpl(int interval) {
- if (nsContext == 0) {
+ if ( 0 != cglContext ) {
+ int[] lval = new int[] { (int) interval } ;
+ CGL.CGLSetParameter(cglContext, CGL.kCGLCPSwapInterval, lval, 0);
+ } else if ( 0 != nsContext ) {
+ CGL.setSwapInterval(nsContext, interval);
+ } else {
throw new GLException("OpenGL context not current");
}
- CGL.setSwapInterval(nsContext, interval);
currentSwapInterval = interval ;
}
@@ -391,6 +335,9 @@ public abstract class MacOSXCGLContext extends
GLContextImpl
// Internals only below this point
//
+ public long getCGLContext() {
+ return cglContext;
+ }
public long getNSContext() {
return nsContext;
}
diff --git
a/src/jogl/classes/com/sun/opengl/impl/macosx/cgl/MacOSXCGLDrawableFactory.java
b/src/jogl/classes/com/sun/opengl/impl/macosx/cgl/MacOSXCGLDrawableFactory.java
index d8c2a01..7bcc4ca 100644
---
a/src/jogl/classes/com/sun/opengl/impl/macosx/cgl/MacOSXCGLDrawableFactory.java
+++
b/src/jogl/classes/com/sun/opengl/impl/macosx/cgl/MacOSXCGLDrawableFactory.java
@@ -105,8 +105,7 @@ public class MacOSXCGLDrawableFactory extends
GLDrawableFactoryImpl implements D
}
public GLContext createExternalGLContext() {
- AbstractGraphicsScreen aScreen = DefaultGraphicsScreen.createDefault();
- return new MacOSXExternalCGLContext(aScreen);
+ return MacOSXExternalCGLContext.create(this, null);
}
public boolean canCreateExternalGLDrawable() {
diff --git
a/src/jogl/classes/com/sun/opengl/impl/macosx/cgl/MacOSXCGLGraphicsConfiguration.java
b/src/jogl/classes/com/sun/opengl/impl/macosx/cgl/MacOSXCGLGraphicsConfiguration.java
index b5d2fc3..c94efc9 100644
---
a/src/jogl/classes/com/sun/opengl/impl/macosx/cgl/MacOSXCGLGraphicsConfiguration.java
+++
b/src/jogl/classes/com/sun/opengl/impl/macosx/cgl/MacOSXCGLGraphicsConfiguration.java
@@ -42,16 +42,193 @@ import com.sun.opengl.impl.*;
import com.sun.gluegen.runtime.NativeLibrary;
public class MacOSXCGLGraphicsConfiguration extends
DefaultGraphicsConfiguration implements Cloneable {
- public MacOSXCGLGraphicsConfiguration(AbstractGraphicsScreen screen,
GLCapabilities capsChosen, GLCapabilities capsRequested) {
+ long pixelformat;
+
+ public MacOSXCGLGraphicsConfiguration(AbstractGraphicsScreen screen,
GLCapabilities capsChosen, GLCapabilities capsRequested,
+ long pixelformat) {
super(screen, capsChosen, capsRequested);
+ this.pixelformat=pixelformat;
}
public Object clone() {
return super.clone();
}
+ protected void setChosenPixelFormat(long pixelformat) {
+ this.pixelformat=pixelformat;
+ }
+
protected void setChosenCapabilities(GLCapabilities caps) {
super.setChosenCapabilities(caps);
}
+
+ protected static final int[] cglInternalAttributeToken = new int[] {
+ CGL.kCGLPFAColorFloat,
+ CGL.NSOpenGLPFAPixelBuffer,
+ CGL.NSOpenGLPFADoubleBuffer,
+ CGL.NSOpenGLPFAStereo,
+ CGL.NSOpenGLPFAColorSize,
+ CGL.NSOpenGLPFAAlphaSize,
+ CGL.NSOpenGLPFADepthSize,
+ CGL.NSOpenGLPFAAccumSize,
+ CGL.NSOpenGLPFAStencilSize,
+ CGL.NSOpenGLPFASampleBuffers,
+ CGL.NSOpenGLPFASamples };
+
+ protected static int[] GLCapabilities2AttribList(GLCapabilities caps) {
+ int[] ivalues = new int[cglInternalAttributeToken.length];
+
+ for (int idx = 0; idx < cglInternalAttributeToken.length; idx++) {
+ int attr = cglInternalAttributeToken[idx];
+ switch (attr) {
+ case CGL.kCGLPFAColorFloat:
+ ivalues[idx] = caps.getPbufferFloatingPointBuffers() ? 1 : 0;
+ break;
+
+ case CGL.NSOpenGLPFAPixelBuffer:
+ ivalues[idx] = caps.isPBuffer() ? 1 : 0;
+ break;
+
+ case CGL.NSOpenGLPFADoubleBuffer:
+ ivalues[idx] = (caps.getDoubleBuffered() ? 1 : 0);
+ break;
+
+ case CGL.NSOpenGLPFAStereo:
+ ivalues[idx] = (caps.getStereo() ? 1 : 0);
+ break;
+
+ case CGL.NSOpenGLPFAColorSize:
+ ivalues[idx] = (caps.getRedBits() + caps.getGreenBits() +
caps.getBlueBits());
+ break;
+
+ case CGL.NSOpenGLPFAAlphaSize:
+ ivalues[idx] = caps.getAlphaBits();
+ break;
+
+ case CGL.NSOpenGLPFADepthSize:
+ ivalues[idx] = caps.getDepthBits();
+ break;
+
+ case CGL.NSOpenGLPFAAccumSize:
+ ivalues[idx] = (caps.getAccumRedBits() +
caps.getAccumGreenBits() + caps.getAccumBlueBits() +
caps.getAccumAlphaBits());
+ break;
+
+ case CGL.NSOpenGLPFAStencilSize:
+ ivalues[idx] = caps.getStencilBits();
+ break;
+
+ case CGL.NSOpenGLPFASampleBuffers:
+ ivalues[idx] = caps.getSampleBuffers() ? 1 : 0;
+ break;
+
+ case CGL.NSOpenGLPFASamples:
+ ivalues[idx] = caps.getSampleBuffers() ? ivalues[idx] =
caps.getNumSamples() : 0;
+ break;
+
+ default:
+ break;
+ }
+ }
+ return ivalues;
+ }
+
+ protected static long GLCapabilities2NSPixelFormat(GLCapabilities caps) {
+ int[] ivalues = GLCapabilities2AttribList(caps);
+ return CGL.createPixelFormat(cglInternalAttributeToken, 0,
cglInternalAttributeToken.length, ivalues, 0);
+ }
+
+ protected static GLCapabilities NSPixelFormat2GLCapabilities(GLProfile
glp, long pixelFormat) {
+ return PixelFormat2GLCapabilities(glp, pixelFormat, true);
+ }
+
+ protected static GLCapabilities CGLPixelFormat2GLCapabilities(GLProfile
glp, long pixelFormat) {
+ return PixelFormat2GLCapabilities(glp, pixelFormat, false);
+ }
+
+ private static GLCapabilities PixelFormat2GLCapabilities(GLProfile glp,
long pixelFormat, boolean nsUsage) {
+ int[] ivalues = new int[cglInternalAttributeToken.length];
+
+ // On this platform the pixel format is associated with the
+ // context and not the drawable. However it's a reasonable
+ // approximation to just store the chosen pixel format up in the
+ // NativeWindow's AbstractGraphicsConfiguration,
+ // since the public API doesn't provide for a different
GLCapabilities per context.
+ // Note: These restrictions of the platform's API might be
considered as a bug anyways.
+
+ // Figure out what attributes we really got
+ GLCapabilities caps = new GLCapabilities(glp);
+ if(nsUsage) {
+ CGL.queryPixelFormat(pixelFormat, cglInternalAttributeToken, 0,
cglInternalAttributeToken.length, ivalues, 0);
+ } else {
+ CGL.CGLQueryPixelFormat(pixelFormat, cglInternalAttributeToken,
0, cglInternalAttributeToken.length, ivalues, 0);
+ }
+ for (int i = 0; i < cglInternalAttributeToken.length; i++) {
+ int attr = cglInternalAttributeToken[i];
+ switch (attr) {
+ case CGL.kCGLPFAColorFloat:
+ caps.setPbufferFloatingPointBuffers(ivalues[i] != 0);
+ break;
+
+ case CGL.NSOpenGLPFAPixelBuffer:
+ caps.setPBuffer(ivalues[i] != 0);
+ break;
+
+ case CGL.NSOpenGLPFADoubleBuffer:
+ caps.setDoubleBuffered(ivalues[i] != 0);
+ break;
+
+ case CGL.NSOpenGLPFAStereo:
+ caps.setStereo(ivalues[i] != 0);
+ break;
+
+ case CGL.NSOpenGLPFAColorSize:
+ {
+ int bitSize = ivalues[i];
+ if (bitSize == 32)
+ bitSize = 24;
+ bitSize /= 3;
+ caps.setRedBits(bitSize);
+ caps.setGreenBits(bitSize);
+ caps.setBlueBits(bitSize);
+ }
+ break;
+
+ case CGL.NSOpenGLPFAAlphaSize:
+ caps.setAlphaBits(ivalues[i]);
+ break;
+
+ case CGL.NSOpenGLPFADepthSize:
+ caps.setDepthBits(ivalues[i]);
+ break;
+
+ case CGL.NSOpenGLPFAAccumSize:
+ {
+ int bitSize = ivalues[i] / 4;
+ caps.setAccumRedBits(bitSize);
+ caps.setAccumGreenBits(bitSize);
+ caps.setAccumBlueBits(bitSize);
+ caps.setAccumAlphaBits(bitSize);
+ }
+ break;
+
+ case CGL.NSOpenGLPFAStencilSize:
+ caps.setStencilBits(ivalues[i]);
+ break;
+
+ case CGL.NSOpenGLPFASampleBuffers:
+ caps.setSampleBuffers(ivalues[i] != 0);
+ break;
+
+ case CGL.NSOpenGLPFASamples:
+ caps.setNumSamples(ivalues[i]);
+ break;
+
+ default:
+ break;
+ }
+ }
+
+ return caps;
+ }
}
diff --git
a/src/jogl/classes/com/sun/opengl/impl/macosx/cgl/MacOSXCGLGraphicsConfigurationFactory.java
b/src/jogl/classes/com/sun/opengl/impl/macosx/cgl/MacOSXCGLGraphicsConfigurationFactory.java
index f59268b..7c2c7b7 100644
---
a/src/jogl/classes/com/sun/opengl/impl/macosx/cgl/MacOSXCGLGraphicsConfigurationFactory.java
+++
b/src/jogl/classes/com/sun/opengl/impl/macosx/cgl/MacOSXCGLGraphicsConfigurationFactory.java
@@ -78,7 +78,7 @@ public class MacOSXCGLGraphicsConfigurationFactory extends
GraphicsConfiguration
capabilities = new GLCapabilities(null);
}
- return new MacOSXCGLGraphicsConfiguration(absScreen,
(GLCapabilities)capabilities, (GLCapabilities)capabilities);
+ return new MacOSXCGLGraphicsConfiguration(absScreen,
(GLCapabilities)capabilities, (GLCapabilities)capabilities, 0);
}
}
diff --git
a/src/jogl/classes/com/sun/opengl/impl/macosx/cgl/MacOSXExternalCGLContext.java
b/src/jogl/classes/com/sun/opengl/impl/macosx/cgl/MacOSXExternalCGLContext.java
index 7283122..03116f6 100644
---
a/src/jogl/classes/com/sun/opengl/impl/macosx/cgl/MacOSXExternalCGLContext.java
+++
b/src/jogl/classes/com/sun/opengl/impl/macosx/cgl/MacOSXExternalCGLContext.java
@@ -40,38 +40,75 @@
package com.sun.opengl.impl.macosx.cgl;
import javax.media.opengl.*;
-import javax.media.nativewindow.*;
import com.sun.opengl.impl.*;
+import javax.media.nativewindow.*;
+import com.sun.nativewindow.impl.NullWindow;
+
public class MacOSXExternalCGLContext extends MacOSXCGLContext {
private boolean firstMakeCurrent = true;
private boolean created = true;
private GLContext lastContext;
- public MacOSXExternalCGLContext(AbstractGraphicsScreen absScreen) {
- super(null, null);
-
- // FIXME: we don't have a "current context" primitive implemented
- // yet on OS X. In the current implementation this would need to
- // return an NSOpenGLContext*, but "external" toolkits are not
- // guaranteed to be using the Cocoa OpenGL API. Additionally, if
- // we switched this implementation to use the low-level CGL APIs,
- // we would lose the ability to share textures and display lists
- // between contexts since you need an NSOpenGLContext, not a
- // CGLContextObj, in order to share textures and display lists
- // between two NSOpenGLContexts.
- //
- // The ramifications here are that it is not currently possible to
- // share textures and display lists between an OpenGL context
- // created by JOGL and one created by a third-party library on OS
- // X.
-
- // context = CGL.CGLGetCurrentContext();
-
+ private MacOSXExternalCGLContext(Drawable drawable, long cglContext, long
nsContext) {
+ super(drawable, null);
+ drawable.setExternalCGLContext(this);
+ this.cglContext = cglContext;
+ this.nsContext = nsContext;
GLContextShareSet.contextCreated(this);
setGLFunctionAvailability(false);
}
+ protected static MacOSXExternalCGLContext create(GLDrawableFactory
factory, GLProfile glp) {
+ ((GLDrawableFactoryImpl)factory).lockToolkit();
+ try {
+ long pixelFormat = 0;
+ long currentDrawable = 0;
+ long cglContext = 0;
+ long nsContext = CGL.getCurrentContext(); // Check: MacOSX 10.3 ..
+ if( 0 != nsContext ) {
+ currentDrawable = CGL.getNSView(nsContext);
+ long ctx = CGL.getCGLContext(nsContext);
+ if (ctx == 0) {
+ throw new GLException("Error: NULL cglContext of nsContext 0x"
+Long.toHexString(nsContext));
+ }
+ pixelFormat = CGL.CGLGetPixelFormat(ctx);
+ if(DEBUG) {
+ System.err.println("MacOSXExternalCGLContext Create
nsContext 0x"+Long.toHexString(nsContext)+
+ ", cglContext 0x"+Long.toHexString(ctx)+
+ ", pixelFormat
0x"+Long.toHexString(pixelFormat));
+ }
+ } else {
+ cglContext = CGL.CGLGetCurrentContext();
+ if (cglContext == 0) {
+ throw new GLException("Error: current cglContext null, no
nsContext");
+ }
+ pixelFormat = CGL.CGLGetPixelFormat(cglContext);
+ if(DEBUG) {
+ System.err.println("MacOSXExternalCGLContext Create
cglContext 0x"+Long.toHexString(cglContext)+
+ ", pixelFormat
0x"+Long.toHexString(pixelFormat));
+ }
+ }
+
+ if (0 == pixelFormat) {
+ throw new GLException("Error: current pixelformat of current
cglContext 0x"+Long.toHexString(cglContext)+" is null");
+ }
+ GLCapabilities caps =
MacOSXCGLGraphicsConfiguration.CGLPixelFormat2GLCapabilities(glp,
pixelFormat);
+ if(DEBUG) {
+ System.err.println("MacOSXExternalCGLContext Create "+caps);
+ }
+
+ AbstractGraphicsScreen aScreen =
DefaultGraphicsScreen.createDefault();
+ MacOSXCGLGraphicsConfiguration cfg = new
MacOSXCGLGraphicsConfiguration(aScreen, caps, caps, pixelFormat);
+
+ NullWindow nw = new NullWindow(cfg);
+ nw.setSurfaceHandle(currentDrawable);
+ return new MacOSXExternalCGLContext(new Drawable(factory, nw),
cglContext, nsContext);
+ } finally {
+ ((GLDrawableFactoryImpl)factory).unlockToolkit();
+ }
+ }
+
protected boolean create() {
return true;
}
@@ -87,6 +124,16 @@ public class MacOSXExternalCGLContext extends
MacOSXCGLContext {
return super.makeCurrent();
}
+ protected void swapBuffers() {
+ DefaultGraphicsConfiguration config = (DefaultGraphicsConfiguration)
drawable.getNativeWindow().getGraphicsConfiguration().getNativeGraphicsConfiguration();
+ GLCapabilities caps = (GLCapabilities)config.getChosenCapabilities();
+ if(caps.isOnscreen()) {
+ if (CGL.kCGLNoError != CGL.CGLFlushDrawable(cglContext)) {
+ throw new GLException("Error swapping buffers");
+ }
+ }
+ }
+
public void release() throws GLException {
super.release();
setCurrent(lastContext);
@@ -114,11 +161,55 @@ public class MacOSXExternalCGLContext extends
MacOSXCGLContext {
}
public void setOpenGLMode(int mode) {
- if (mode != MacOSXCGLDrawable.NSOPENGL_MODE)
+ if (mode != MacOSXCGLDrawable.CGL_MODE)
throw new GLException("OpenGL mode switching not supported for
external GLContexts");
}
public int getOpenGLMode() {
- return MacOSXCGLDrawable.NSOPENGL_MODE;
+ return MacOSXCGLDrawable.CGL_MODE;
+ }
+
+ // Need to provide the display connection to extension querying APIs
+ static class Drawable extends MacOSXCGLDrawable {
+ MacOSXExternalCGLContext extCtx;
+
+ Drawable(GLDrawableFactory factory, NativeWindow comp) {
+ super(factory, comp, true);
+ }
+
+ void setExternalCGLContext(MacOSXExternalCGLContext externalContext) {
+ extCtx = externalContext;
+ }
+
+ public GLContext createContext(GLContext shareWith) {
+ throw new GLException("Should not call this");
+ }
+
+ public int getWidth() {
+ throw new GLException("Should not call this");
+ }
+
+ public int getHeight() {
+ throw new GLException("Should not call this");
+ }
+
+ public void setSize(int width, int height) {
+ throw new GLException("Should not call this");
+ }
+
+ protected void swapBuffersImpl() {
+ if (extCtx != null) {
+ extCtx.swapBuffers();
+ }
+ }
+
+ public void setOpenGLMode(int mode) {
+ if (mode != CGL_MODE)
+ throw new GLException("OpenGL mode switching not supported for
external GLContext's drawables");
+ }
+
+ public int getOpenGLMode() {
+ return CGL_MODE;
+ }
}
}
diff --git
a/src/jogl/classes/com/sun/opengl/impl/x11/glx/X11ExternalGLXContext.java
b/src/jogl/classes/com/sun/opengl/impl/x11/glx/X11ExternalGLXContext.java
index 0603f1c..b509447 100755
--- a/src/jogl/classes/com/sun/opengl/impl/x11/glx/X11ExternalGLXContext.java
+++ b/src/jogl/classes/com/sun/opengl/impl/x11/glx/X11ExternalGLXContext.java
@@ -53,7 +53,6 @@ public class X11ExternalGLXContext extends X11GLXContext {
private X11ExternalGLXContext(Drawable drawable, long context) {
super(drawable, null);
- this.drawable = drawable;
this.context = context;
GLContextShareSet.contextCreated(this);
setGLFunctionAvailability(false);
diff --git a/src/jogl/native/macosx/MacOSXCustomCGLCode.c
b/src/jogl/native/macosx/MacOSXCustomCGLCode.c
new file mode 100644
index 0000000..c29be88
--- /dev/null
+++ b/src/jogl/native/macosx/MacOSXCustomCGLCode.c
@@ -0,0 +1,24 @@
+#include <stdlib.h>
+
+#include <assert.h>
+
+#include </usr/include/machine/types.h>
+#include "macosx-window-system.h"
+
+void CGLQueryPixelFormat(void* pixelFormat, int* iattrs, int niattrs, int*
ivalues) {
+ CGLPixelFormatObj pix = (CGLPixelFormatObj) pixelFormat;
+ // FIXME: think about how specifying this might affect the API
+ int virtualScreen = 0;
+
+ int i;
+ GLint value;
+ for (i = 0; i < niattrs && iattrs[i]>0; i++) {
+ CGLPixelFormatAttribute attr = (CGLPixelFormatAttribute) iattrs[i];
+ if ( kCGLNoError == CGLDescribePixelFormat(pix, virtualScreen, attr,
&value) ) {
+ ivalues[i] = value;
+ } else {
+ ivalues[i] = 0;
+ }
+ }
+}
+
diff --git a/src/jogl/native/macosx/MacOSXWindowSystemInterface.m
b/src/jogl/native/macosx/MacOSXWindowSystemInterface.m
index 350f615..5405ad4 100644
--- a/src/jogl/native/macosx/MacOSXWindowSystemInterface.m
+++ b/src/jogl/native/macosx/MacOSXWindowSystemInterface.m
@@ -382,7 +382,7 @@ void* createPixelFormat(int* iattrs, int niattrs, int*
ivalues) {
int idx = 0;
int i;
- for (i = 0; i < niattrs; i++) {
+ for (i = 0; i < niattrs && iattrs[i]>0; i++) {
int attr = iattrs[i];
switch (attr) {
case NSOpenGLPFAPixelBuffer:
@@ -451,7 +451,7 @@ void queryPixelFormat(void* pixelFormat, int* iattrs, int
niattrs, int* ivalues)
int virtualScreen = 0;
int i;
- for (i = 0; i < niattrs; i++) {
+ for (i = 0; i < niattrs && iattrs[i]>0; i++) {
[fmt getValues: &tmp
forAttribute: (NSOpenGLPixelFormatAttribute) iattrs[i]
forVirtualScreen: virtualScreen];
@@ -524,8 +524,37 @@ void* createContext(void* shareContext,
return nsContext;
}
-Bool makeCurrentContext(void* context) {
- NSOpenGLContext *nsContext = (NSOpenGLContext*)context;
+void * getCurrentContext() {
+ NSOpenGLContext *nsContext = NULL;
+
+ NSAutoreleasePool* pool = [[NSAutoreleasePool alloc] init];
+ nsContext = [NSOpenGLContext currentContext];
+ [pool release];
+ return nsContext;;
+}
+
+void * getCGLContext(void* nsJContext) {
+ NSOpenGLContext *nsContext = (NSOpenGLContext*)nsJContext;
+ void * cglContext = NULL;
+
+ NSAutoreleasePool* pool = [[NSAutoreleasePool alloc] init];
+ cglContext = [nsContext CGLContextObj];
+ [pool release];
+ return cglContext;
+}
+
+void * getNSView(void* nsJContext) {
+ NSOpenGLContext *nsContext = (NSOpenGLContext*)nsJContext;
+ void * view = NULL;
+
+ NSAutoreleasePool* pool = [[NSAutoreleasePool alloc] init];
+ view = [nsContext view];
+ [pool release];
+ return view;
+}
+
+Bool makeCurrentContext(void* nsJContext) {
+ NSOpenGLContext *nsContext = (NSOpenGLContext*)nsJContext;
NSAutoreleasePool* pool = [[NSAutoreleasePool alloc] init];
[nsContext makeCurrentContext];
@@ -533,15 +562,21 @@ Bool makeCurrentContext(void* context) {
return true;
}
-Bool clearCurrentContext(void* context) {
+Bool clearCurrentContext(void* nsJContext) {
+ NSOpenGLContext *nsContext = (NSOpenGLContext*)nsJContext;
+
NSAutoreleasePool* pool = [[NSAutoreleasePool alloc] init];
+ NSOpenGLContext *currentNSContext = [NSOpenGLContext currentContext];
+ if( currentNSContext != nsContext ) {
+ [nsContext makeCurrentContext];
+ }
[NSOpenGLContext clearCurrentContext];
[pool release];
return true;
}
-Bool deleteContext(void* context) {
- NSOpenGLContext *nsContext = (NSOpenGLContext*)context;
+Bool deleteContext(void* nsJContext) {
+ NSOpenGLContext *nsContext = (NSOpenGLContext*)nsJContext;
NSAutoreleasePool* pool = [[NSAutoreleasePool alloc] init];
[nsContext clearDrawable];
@@ -550,8 +585,8 @@ Bool deleteContext(void* context) {
return true;
}
-Bool flushBuffer(void* context) {
- NSOpenGLContext *nsContext = (NSOpenGLContext*)context;
+Bool flushBuffer(void* nsJContext) {
+ NSOpenGLContext *nsContext = (NSOpenGLContext*)nsJContext;
NSAutoreleasePool* pool = [[NSAutoreleasePool alloc] init];
[nsContext flushBuffer];
@@ -559,14 +594,14 @@ Bool flushBuffer(void* context) {
return true;
}
-void setContextOpacity(void* context, int opacity) {
- NSOpenGLContext *nsContext = (NSOpenGLContext*)context;
+void setContextOpacity(void* nsJContext, int opacity) {
+ NSOpenGLContext *nsContext = (NSOpenGLContext*)nsJContext;
[nsContext setValues:&opacity forParameter:NSOpenGLCPSurfaceOpacity];
}
-void updateContext(void* context) {
- NSOpenGLContext *nsContext = (NSOpenGLContext*)context;
+void updateContext(void* nsJContext) {
+ NSOpenGLContext *nsContext = (NSOpenGLContext*)nsJContext;
NSAutoreleasePool* pool = [[NSAutoreleasePool alloc] init];
[nsContext update];
@@ -579,8 +614,8 @@ void copyContext(void* destContext, void* srcContext, int
mask) {
[dst copyAttributesFromContext: src withMask: mask];
}
-void* updateContextRegister(void* context, void* view) {
- NSOpenGLContext *nsContext = (NSOpenGLContext*)context;
+void* updateContextRegister(void* nsJContext, void* view) {
+ NSOpenGLContext *nsContext = (NSOpenGLContext*)nsJContext;
NSView *nsView = (NSView*)view;
NSAutoreleasePool* pool = [[NSAutoreleasePool alloc] init];
@@ -590,7 +625,7 @@ void* updateContextRegister(void* context, void* view) {
return NULL;
}
-void updateContextUnregister(void* context, void* view, void* updater) {
+void updateContextUnregister(void* updater) {
ContextUpdater *contextUpdater = (ContextUpdater *)updater;
NSAutoreleasePool* pool = [[NSAutoreleasePool alloc] init];
@@ -610,10 +645,8 @@ void* createPBuffer(int renderTarget, int
internalFormat, int width, int height)
return pBuffer;
}
-Bool destroyPBuffer(void* context, void* buffer) {
+Bool destroyPBuffer(void* buffer) {
/* FIXME: not clear whether we need to perform the clearDrawable below */
- /* FIXME: remove the context argument -- don't need it any more */
- /* NSOpenGLContext *nsContext = (NSOpenGLContext*)context; */
NSOpenGLPixelBuffer *pBuffer = (NSOpenGLPixelBuffer*)buffer;
NSAutoreleasePool* pool = [[NSAutoreleasePool alloc] init];
@@ -628,8 +661,8 @@ Bool destroyPBuffer(void* context, void* buffer) {
return true;
}
-void setContextPBuffer(void* context, void* buffer) {
- NSOpenGLContext *nsContext = (NSOpenGLContext*)context;
+void setContextPBuffer(void* nsJContext, void* buffer) {
+ NSOpenGLContext *nsContext = (NSOpenGLContext*)nsJContext;
NSOpenGLPixelBuffer *pBuffer = (NSOpenGLPixelBuffer*)buffer;
NSAutoreleasePool* pool = [[NSAutoreleasePool alloc] init];
@@ -640,8 +673,8 @@ void setContextPBuffer(void* context, void* buffer) {
[pool release];
}
-void setContextTextureImageToPBuffer(void* context, void* buffer, int
colorBuffer) {
- NSOpenGLContext *nsContext = (NSOpenGLContext*)context;
+void setContextTextureImageToPBuffer(void* nsJContext, void* buffer, int
colorBuffer) {
+ NSOpenGLContext *nsContext = (NSOpenGLContext*)nsJContext;
NSOpenGLPixelBuffer *pBuffer = (NSOpenGLPixelBuffer*)buffer;
NSAutoreleasePool* pool = [[NSAutoreleasePool alloc] init];
@@ -686,8 +719,8 @@ void* getProcAddress(const char *procname) {
return NULL;
}
-void setSwapInterval(void* context, int interval) {
- NSOpenGLContext *nsContext = (NSOpenGLContext*)context;
+void setSwapInterval(void* nsJContext, int interval) {
+ NSOpenGLContext *nsContext = (NSOpenGLContext*)nsJContext;
long swapInterval = interval;
[nsContext setValues: &swapInterval forParameter: NSOpenGLCPSwapInterval];
}
diff --git a/REPOSITORIES.txt b/REPOSITORIES.txt
new file mode 100644
index 0000000..fafd453
--- /dev/null
+++ b/REPOSITORIES.txt
@@ -0,0 +1 @@
+test ..
diff --git
a/src/jogl/classes/com/sun/opengl/impl/macosx/cgl/MacOSXPbufferCGLDrawable.java
b/src/jogl/classes/com/sun/opengl/impl/macosx/cgl/MacOSXPbufferCGLDrawable.java
index 2d7b3ea..bb0984e 100644
---
a/src/jogl/classes/com/sun/opengl/impl/macosx/cgl/MacOSXPbufferCGLDrawable.java
+++
b/src/jogl/classes/com/sun/opengl/impl/macosx/cgl/MacOSXPbufferCGLDrawable.java
@@ -212,7 +212,7 @@ public class MacOSXPbufferCGLDrawable extends
MacOSXCGLDrawable {
}
public void destroy(long pbuffer) {
- CGL.destroyPBuffer(0, pbuffer);
+ CGL.destroyPBuffer(pbuffer);
}
}
diff --git a/src/newt/classes/com/sun/javafx/newt/x11/X11Window.java
b/src/newt/classes/com/sun/javafx/newt/x11/X11Window.java
index 57653a6..46e797c 100755
--- a/src/newt/classes/com/sun/javafx/newt/x11/X11Window.java
+++ b/src/newt/classes/com/sun/javafx/newt/x11/X11Window.java
@@ -98,31 +98,37 @@ public class X11Window extends Window {
}
public void setSize(int width, int height) {
- if(0==windowHandle) return;
- if(!visible) {
- // set values, since no event roundtrip will happen to set them
- this.width = width;
- this.height = height;
+ if(DEBUG_IMPLEMENTATION) {
+ System.err.println("X11Window setSize: "+this.x+"/"+this.y+"
"+this.width+"x"+this.height+" -> "+width+"x"+height);
+ // Exception e = new Exception("XXXXXXXXXX");
+ // e.printStackTrace();
}
+ this.width = width;
+ this.height = height;
if(!fullscreen) {
nfs_width=width;
nfs_height=height;
}
- setSize0(parentWindowHandle, getDisplayHandle(), getScreenIndex(),
windowHandle, x, y, width, height, (undecorated||fullscreen)?-1:1, false);
+ if(0!=windowHandle) {
+ setSize0(parentWindowHandle, getDisplayHandle(),
getScreenIndex(), windowHandle, x, y, width, height,
(undecorated||fullscreen)?-1:1, false);
+ }
}
public void setPosition(int x, int y) {
- if(0==windowHandle) return;
- if(!visible) {
- // set values, since no event roundtrip will happen to set them
- this.x = x;
- this.y = y;
+ if(DEBUG_IMPLEMENTATION) {
+ System.err.println("X11Window setPosition: "+this.x+"/"+this.y+"
-> "+x+"/"+y);
+ // Exception e = new Exception("XXXXXXXXXX");
+ // e.printStackTrace();
}
+ this.x = x;
+ this.y = y;
if(!fullscreen) {
nfs_x=x;
nfs_y=y;
}
- setPosition0(getDisplayHandle(), windowHandle, x, y);
+ if(0!=windowHandle) {
+ setPosition0(getDisplayHandle(), windowHandle, x, y);
+ }
}
public boolean setFullscreen(boolean fullscreen) {
@@ -162,6 +168,9 @@ public class X11Window extends Window {
private void windowChanged(int newX, int newY, int newWidth, int
newHeight) {
if(width != newWidth || height != newHeight) {
+ if(DEBUG_IMPLEMENTATION) {
+ System.err.println("X11Window windowChanged size:
"+this.width+"x"+this.height+" -> "+newWidth+"x"+newHeight);
+ }
width = newWidth;
height = newHeight;
if(!fullscreen) {
@@ -170,7 +179,10 @@ public class X11Window extends Window {
}
sendWindowEvent(WindowEvent.EVENT_WINDOW_RESIZED);
}
- if(x != newX || y != newY) {
+ if( 0==parentWindowHandle && ( x != newX || y != newY ) ) {
+ if(DEBUG_IMPLEMENTATION) {
+ System.err.println("X11Window windowChanged position:
"+this.x+"/"+this.y+" -> "+newX+"x"+newY);
+ }
x = newX;
y = newY;
if(!fullscreen) {
diff --git a/src/newt/native/X11Window.c b/src/newt/native/X11Window.c
index 7e1f5d9..0242678 100755
--- a/src/newt/native/X11Window.c
+++ b/src/newt/native/X11Window.c
@@ -63,6 +63,10 @@
#define DBG_PRINT2(str, arg1, arg2) fprintf(stderr, str, arg1, arg2);
#define DBG_PRINT3(str, arg1, arg2, arg3) fprintf(stderr, str, arg1,
arg2, arg3);
#define DBG_PRINT4(str, arg1, arg2, arg3, arg4) fprintf(stderr, str,
arg1, arg2, arg3, arg4);
+ #define DBG_PRINT5(str, arg1, arg2, arg3, arg4, arg5) fprintf(stderr,
str, arg1, arg2, arg3, arg4, arg5);
+ #define DBG_PRINT6(str, arg1, arg2, arg3, arg4, arg5, arg6)
fprintf(stderr, str, arg1, arg2, arg3, arg4, arg5, arg6);
+ #define DBG_PRINT7(str, arg1, arg2, arg3, arg4, arg5, arg6, arg7)
fprintf(stderr, str, arg1, arg2, arg3, arg4, arg5, arg6, arg7);
+ #define DBG_PRINT8(str, arg1, arg2, arg3, arg4, arg5, arg6, arg7, arg8)
fprintf(stderr, str, arg1, arg2, arg3, arg4, arg5, arg6, arg7, arg8);
#define DUMP_VISUAL_INFO(a,b) _dumpVisualInfo((a),(b))
@@ -95,6 +99,10 @@
#define DBG_PRINT2(str, arg1, arg2)
#define DBG_PRINT3(str, arg1, arg2, arg3)
#define DBG_PRINT4(str, arg1, arg2, arg3, arg4)
+ #define DBG_PRINT5(str, arg1, arg2, arg3, arg4, arg5)
+ #define DBG_PRINT6(str, arg1, arg2, arg3, arg4, arg5, arg6)
+ #define DBG_PRINT7(str, arg1, arg2, arg3, arg4, arg5, arg6, arg7)
+ #define DBG_PRINT8(str, arg1, arg2, arg3, arg4, arg5, arg6, arg7, arg8)
#
[truncated due to length]
|
[jogl~jogl-git:eab82899] X11 Display Lock completed (hope so) |
svengothel | 10/13/2009 |





