aboutsummaryrefslogtreecommitdiffstats
path: root/src/jogl/classes/com/jogamp/opengl/impl/windows/wgl
Commit message (Collapse)AuthorAgeFilesLines
* Move implementation private files from com.jogamp.<module>.impl. to ↵Sven Gothel2011-02-0817-3912/+0
| | | | | | | | | | | | | | | jogamp.<module> (1/2) - rename task - com.jogamp.opengl.impl -> jogamp.opengl - com.jogamp.opengl.util.glsl.fixedfunc.impl -> jogamp.opengl.util.glsl.fixedfunc - com.jogamp.nativewindow.impl -> jogamp.nativewindow - com.jogamp.newt.impl -> jogamp.newt This sorts implementation details from the top level, ie skipping the public 'com', allowing a better seperation of public classes and implementation details and also reduces strings. This approach of public/private seperation is also used in the OpenJDK.
* Fix GLContext ProcAddressTable Caching: Add sw/hw accel bit to hash value ↵Sven Gothel2011-02-061-1/+1
| | | | due to possible diff function ptr of sw impl (NV/Win7)
* Fix bug #459 NV/Win7 PDF/caps selectionSven Gothel2011-02-052-8/+24
| | | | | | | | | | | | | Scenario - NV / Win7 driver version 266.58's - Caps: on-scr, rgba 8/8/8/0, accum-rgba 0/0/0/0, dp/st/ms: 16/8/0, dbl, mono The above 'wglChoosePixelFormatARB' impl returns an array of pixelformats, where the 1st entry is not hardware accelerated! This should be considered a bug in NV's driver, since the array should return a list ordered from 'best' to 'worst'. Workaround trying explicit hw acceleration 1st, then generic, then software.
* Fix bug #461 on NV/Win (caps selection)Sven Gothel2011-02-052-9/+9
| | | | | | Allows TestBug461OffscreenSupersamplingSwingAWT to pass on NV/Win7. Root cause was using the requested unfixed caps (onscreen, !pbuffer) instead of the fixed ones.
* Fix for Bug #452Sven Gothel2011-02-034-103/+104
| | | | | | | | | | | | | WindowsWGLGraphicsConfiguration.create(..) -> WindowsWGLGraphicsConfiguration.createFromCurrent(..) emphasizing that all resources are 'current' ie locked and available. This method is used for the external context/drawable creation only, called while they are current. Hence this method no more makeCurrent/release, which interfered with the current external context state. WindowsWGLGraphicsConfigurationFactory: Move surface locking to the right (common) place.
* JOGL change of default GLProfile order: GL4bc, GL3bc, GL2, GL2GL3, GL4, GL3, ↵Sven Gothel2011-01-311-1/+1
| | | | GL2ES2, GLES2, GL2ES1, GLES1
* Fix WindowsDummyWGLDrawable: onscreen && !pbufferSven Gothel2011-01-311-1/+0
|
* GLCapabilities enhancements: Choosing, All-Available, Data Handling (X11, ↵Sven Gothel2011-01-317-494/+578
| | | | | | | | | | | | | | | | | | | | | | | | | | WGL and EGL) - GLDrawableFactory exposes: public final List/*GLCapabilitiesImmutable*/ getAvailableCapabilities(AbstractGraphicsDevice device) - GLCapabilities platform specialization containing native ids (XVisual/FBConfig, PFD, EGLConfig, ..) - GLCapabilities setPbuffer(true) disables onscreen - Capabilities setOnscreen(true) disables pbuffer - Capabilities implements Comparable - *Capabilities: enhanced 'toString(..)' - CapabilitiesChooser.chooseCapabilities: 'CapabilitiesImmutable[] available' -> 'List /*<CapabilitiesImmutable>*/ available' - VersionApplet, GLCanvas.main, GLWindow.main, GLProfile/debug: dumps all available GLCaps - WGLGLCapabilities: proper non-displayeble (pbuffer) pfdid handling TODO: ES/EGL test with emulation
* Fix WGL bitmap regression while fixing it ↵Sven Gothel2010-12-221-2/+1
| | | | (96a0e0706258824c1dd524d4cbd7682a904b84f4)
* Adding NVIDIA 'Threaded optimization' workaround/fix at initialization on ↵Sven Gothel2010-12-191-0/+37
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Windows for javaws/applets. It has been observed that for some combinations, eg: - Windows 7 64bit (other variants may apply too) - NVIDIA 8600M GT - 260.99 the NVIDIA setting of 'Threaded optimization' := 'auto' (default) causes the JVM to simply crash in case of javaws and [jnlp] applets. 'Threaded Optimization' := 'off' works reliable 'Threaded Optimization' := 'on' never works with javaws and applets on the above configuration A user could workaround this by setting 'Threaded Optimization' := 'off', however, this would disable many users on the spot, since you cannot ask the average user for such a task, if she only wants to see a web page. This patch 'fixes' the 'auto' mode by running the eager GL profile initialization within a block of single CPU affinity: SetProcessAffinityMask(pid, 1); try { initProfilesForDeviceImpl(device); } finally { SetProcessAffinityMask(pid, sysValue); } Hopefully we can remove this hack with a driver fix. However this workaround is as little invasive as possible.
* Debug/Cleanup: toString: print base classname only; Misc ..Sven Gothel2010-12-191-1/+8
|
* WindowsWGLContext: Proper var names, misc cleanupSven Gothel2010-12-181-17/+22
|
* convenient internal queries for sharedSven Gothel2010-12-181-0/+12
|
* debug node: WindowsDummyWGLDrawableSven Gothel2010-12-171-0/+1
|
* Fix WGL Bitmap Offscreen DrawableSven Gothel2010-12-164-20/+73
| | | | | | | | | | | In conjunction with the gluegen investigation (gluegen: fbdedff789077b5ffa07811590f771b6f9a4f3a7), on Windows the type LONG is always 32bit, hence we have to declare: typedef __int32 LONG; Besides, WGL_DRAW_TO_PBUFFER_ARB and WGL_DRAW_TO_BITMAP_ARB were missing in the WGL/ARB attribute query, and the latter was not set in caps -> attributes. Added fail safe exception for null chosen caps, if X11/WGL algo fails to determine.
* NativeWindow: Move RegisteredClass to private impl packageSven Gothel2010-12-121-1/+1
|
* Windows RegisterClass: Use new RegisteredClassFactory (window class), Misc.Sven Gothel2010-12-122-31/+72
| | | | | | | | | | | | | | | | | This solves the issue when an applet is started/stop and started again, or another applet runs in the same JVM. Also soves the issue for multiple JVMs. RegisteredClassFactory can be instanced to manage one shared window class, currently in use for GDI's dummy window and NEWT. A class base name and a window proc handle must be passed in the factory cstr. Before registering, the class is tested if already exists, eg another applet in the same JVM. If registration fails, the class name will iterate until successful or MAX_INT reached, eg if multiple JVMs are running. Added NativeWindow Common Native Code.
* Generalize SharedResourceRunner and use/impl it for WGL as well (besides X11).Sven Gothel2010-12-111-106/+137
| | | | | It seems necessary to use off thread shared resources (dummy window, drawable and context) to keep them alive in Java Webstart.
* WGL/DummyWindow: Roll back GetDC/ReleaseDC via lock/unlock surface, ↵Sven Gothel2010-12-101-54/+26
| | | | redundant, since it's static DC
* Cleanup GLGraphicsConfiguration[Factory] implementations (X11/WGL)Sven Gothel2010-12-108-358/+467
| | | | | | | | | | | | | | | | | - AWT/WGL: - Using sun.awt.Win32GraphicsConfig via reflection, if supported, else we may fail. - Preselection of PFD as follows: - 1st choice is to create our own AWT GraphicsConfig (GC) based on PFD/GLCaps, ignoring WGL_SUPPORT_GDI_ARB, PFD_SUPPORT_GDI - 2nd choice is to use AWT PFD pool of GC's - else we fail -> use NewtCanvasAWT instead (TODO: Other JDK/AWT implementations ?) - Set PFD will be performed at setRealized(..) - SharedContext (X11/WGL) is synchronized to allow multithreaded access, if required - Simplified and unified (X11/WGL) GraphicsConfigurationFactory - WGL 'external' drawables will be determined with given arguments right away
* JOGL: GLContextImpl's updateGLXProcAddressTable(..) only uses device as a ↵Sven Gothel2010-12-091-23/+23
| | | | | | | | | key for cached table, since the GLX/WGL/etc function entry pointers are GL profile agnostic. Hence createContextARBImpl(..) (WGL/GLX) does not need a sharedContext, but just can issue the inexpensive updateGLXProcAddressTable(..) call.
* DummyWindow: 64x64, WGL: Use lockSurface/unlockSurface block to gather / ↵Sven Gothel2010-12-091-10/+55
| | | | release HDC
* WGL DummyWindow: Use size 128x128 and set size in proxySven Gothel2010-12-041-1/+3
|
* Windows WGL fixes updateGraphicsConfiguration(..) and DummyWGLDrawableSven Gothel2010-12-032-31/+30
| | | | | | | | WindowsWGLGraphicsConfiguration: If updateGraphicsConfigurationARB fails, continue with updateGraphicsConfigurationGDI WindowsDummyWGLDrawable: Utilize proper GraphicsConfiguration selection using updateGraphicsConfiguration()
* Cleanup GLDrawableFactory API and platform ImplementationsSven Gothel2010-12-034-40/+65
| | | | | | | | | | | | | | | | | | | | | | | - Finish API change using the AbstractGraphicsDevice, which denotes the target device for the desired NativeSurface / GLDrawable. The AbstractGraphicsDevice argument may be null to reflect the platform's default device. Clarified API documentation. This move is necessary to make the API coherent. - createOffscreenDrawable(..) may create a Pbuffer drawable if caps and supported. This unifies the functionality with createGLDrawable(..). Further more, a Pbuffer drawable is an offscreen as well. - added createOffscreenSurface(..) following the same behavior as createOffscreenDrawable(..), this is a convenient native offscreen surface factory entry. - removed createGLPbufferDrawable(..), use createOffscreenDrawable(..), since it is redundant! Implementation Details: - EGLDrawableFactory holds a shared native EGLGraphicsDevice, being used by the offscreen EGL drawable (no more multiple creation).
* JOGL: Proper handling of Read Drawable Support (if not supported), add query.Sven Gothel2010-11-282-39/+68
| | | | | | | | | | | | | | | | | | | Read Drawable feature reflects the make context current API having a seperate read drawable next to the write drawable (default). glXMakeContextCurrent(write, read, ..) On X11 a ready drawable is only supported for GLX >= 1.3, on Windows only if extension WGL_ARB_make_current_read is available, on EGL it's always supported, on OSX not at all. API cleanup GLContext: changes: setGLDrawableRead(GLDrawable) -> setGLReadDrawable(GLDrawable) new: isGLReadDrawableAvailable() new: getGLExtensionsString(); Access qualifier cleanup. GLContextImpl: GLVersionNumber moved out.
* WGL: Add GetLastError in case external context/drawable can't be retrievedSven Gothel2010-11-262-5/+5
|
* Reduce visibility -> package privateSven Gothel2010-11-263-53/+52
|
* JOGL/Windows/ATI r3xx: Bug #438: tolerate release context if GetLastError is ↵Sven Gothel2010-11-251-11/+18
| | | | SUCCESS
* NativeWindow/GDI: Adding ERROR_SUCCESS to make the code more clear.Sven Gothel2010-11-254-10/+13
|
* X11/WGL: Unify GraphicsConfiguration Selection - Fixes WGL Bugs 397, 410, ↵Sven Gothel2010-11-236-292/+458
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 429, 428 and 405 Fixes bugs WGL pixelformat related bugs: http://jogamp.org/bugzilla/show_bug.cgi?id=397 http://jogamp.org/bugzilla/show_bug.cgi?id=410 http://jogamp.org/bugzilla/show_bug.cgi?id=429 http://jogamp.org/bugzilla/show_bug.cgi?id=428 http://jogamp.org/bugzilla/show_bug.cgi?id=405 Tested on Window7-x86 (amd/nvidia), WinXP-x32-VirtualBox. Solution: Cleaned up X11/GLX code to use it as a correct boilerplate for the new WGL selection, which now duplicates the same behavior. X11/GLX and WGL follow the common logic: - 1st try: - get GLCapabilities based on users GLCapabilities - setting recommendedIndex as preferred choice - 2nd try: - get all GLCapabilities available - no preferred recommendedIndex available If no recommendedIndex has been selected and no chooser has been passed, we use the DefaultGLCapabilitiesChooser. Choose the GLCapabilities if a chooser is given (or see above).
* JOGL: Fix CreateDummyWindow usage, no more sync needed, since the Window ↵Sven Gothel2010-11-221-5/+1
| | | | class HINSTANCE is acquired at static initialization
* JOGL/AWT: Fix ~ 2 year old regressions: Choose & Use GraphicsConfiguration ↵Sven Gothel2010-11-185-44/+52
| | | | | | | | | | | | | | for Canvas. ; Adding FSAA test. Canvas/X11: The Canvas GraphicsConfiguraton should be chosen before the native peer is being created. Choosing AWT GraphicsConfiguration (all platforms): Don't filter our capabilities with 'AWTGraphicsConfiguration.setupCapabilitiesRGBABits(capsChosen, gc)', not necessary (see above) and it would remove ourrequired alpha channel. Canvas display(): Don't render if drawable is not realized (yet).
* Finishing Immutable changes including GLCapabiltiesImmutable.Sven Gothel2010-11-179-87/+117
|
* Move GDI GlueGen wrapping from JOGL -> NativeWindow (following X11). Moving ↵Sven Gothel2010-11-1710-52/+142
| | | | NEWT WindowsWindow GetRelativeLocation() native implementation to GDI as well.
* NativeWindow AbstractGraphicsDevice: Add 'unitID' attribute and getUniqueID()Sven Gothel2010-11-155-12/+8
| | | | | | | | | | Preparation to support multiple devices on one machine, hence adding the unitID a unique ID/index of the associated GPU, or GPU affinity. Adding getUniqueID() to return a cached semantic unique string id for the device. This was removed from the temp. impl in JOGL's GLContext, added unitID. All other changes just adapt to the above.
* JOGL X11/WGL: Proper usage of the shared resources in implementationSven Gothel2010-11-141-24/+23
|
* JOGL: Complete eager and lazy mapping of GLProfiles in respect to multiple ↵Sven Gothel2010-11-144-86/+193
| | | | | | | | | | | | | | device. AbstractGraphicsDevice's 'connection' and 'type' attribute is used as a unique key to map GLProfiles and GLContext's major/profile -> major/minor/profile mapping. Eager initialiaztion as well as lazy is supported to maintain a simple API. This is currently tested on X11, where one app display NEWT/GL window and content on the local and remote device. See TestRemoteWindow01NEWT.java and TestRemoteGLWindows01NEWT.java
* AbstractGraphicsDevice ..: Add device/display connection attribute to ↵Sven Gothel2010-11-122-7/+2
| | | | | | | | | | support multi devices & displays. Currently only the X11 Display connection is implemented to support multiple device connections. Other platforms may follow. This allows correct mapping and caching of higher level resources, eg. ProcAddressTable, GL version mapping etc with respect to the display device.
* JOGL/X11: Fix context scanning, misc simplifications ..Sven Gothel2010-11-031-30/+27
| | | | | | | | | | | | | | | | | | | Fix context scanning --------------------- Ie on 3.0 NVidia systems, trying to create a 4.1 context leads to a BadAlloc X11 error. A prev patch disabled the X11 error handler, to reduce sideeffects. In case AWT is not being used, the BadAlloc isn't catched and the JVM freezes within the native function call. Decorating context scanning with NativeWindow's 'setX11ErrorHandler' solves this issue. Simplifications ----------------- X11: always try a direct context. If this is not possible due to the display connection, an indirect is being used anyways. Hence 'createContext(boolean direct)' -> 'createImpl()'. X11/WGL: Simplify the context creation logic a bit.
* JOGL DrawableFactory/AWT: Only use AWT factory if AWT is enabledSven Gothel2010-11-031-4/+6
| | | | .. and a little cleanup in the X11 SharedResourceRunner
* JOGL: HashMap ProcAddressTable for all GL profiles incl GLX/WGL/CGL/EGLSven Gothel2010-10-291-6/+24
| | | | | | | Reduce (performance/footprint) overhead of ProcAddressTable recreation, instead use a hashmap (major, minor, profile) -> ProcAddressTable. Remove GL2ES12 implementation profile, redundant.
* Promoted the shutdown hook from GLDrawableFactoryImpl to GLProfile.Sven Gothel2010-10-291-2/+1
| | | | | Each GLDrawableFactory implementation provides a shutdownInstance() method, issued by GLProfile.
* JOGL: Reenable Applet/Webstart/RCP support for JOGL + AWT + X11Sven Gothel2010-10-147-26/+27
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Changed GLProfile/NativeWindowFactory/.. initialization methodology: GLProfile: public static synchronized void initSingleton(final boolean firstUIActionOnProcess); NativeWindowFactory: public static synchronized void initSingleton(final boolean firstUIActionOnProcess); +++ Introducing NativeWindow ToolkitLock, implementations are NullToolkitLock JAWTToolkitLock X11JAWTToolkitLock X11ToolkitLock AbstractGraphicsDevice provides generic global toolkit locking methods, implemented by the ToolkitLock interface. ToolkitLock's are aggregated in NativeWindow's DefaultGraphicsDevice to implement it's superclass lock()/unlock() methods. This enables a device specific locking strategy, ie on X11/AWT utilizing JAWT && X11 locking, and maybe none for others (NEWT). No locking is required for X11 / AWT, in case the above mentioned initialization happened as a 'firstUIActionOnProcess'. The ToolkitLock factory is currently a hardcoded part of NativeWindowFactory. We may have to allow 3rd party NativeWindow implementations to register custom ones. +++ com.jogamp.opengl.impl.GLDrawableImpl cleanup: Dealing with all locking code, providing all public methods. Exceptions are commented. Specializations x11/windows/.. only contains platform code. Pulled down access qualifiers if possible public -> protected. com.jogamp.nativewindow.impl.x11.X11Util Wrapping all X11Lib method with the new locking code. com.jogamp.nativewindow.impl.jawt.JAWTUtil Utilize global SunToolkit.awtLock() is available, the fallback to global JAWT.lock(). The latter just invokes the first. javax.media.nativewindow.awt.AWTGraphicsDevice setHandle(long handle) -> setSubType(String type, long handle) which also resets the ToolkitLock respecting the new type. This ensures correct locking after the sub type has been determined, ie AWT using an X11 peer. +++ Misc Changes done on the way .. GLCanvas: Fixed inversed this.drawableHelper.isExternalAnimatorAnimating() condition, which disabled normal repaint. GLJPanel: Removed drawableHelper.isExternalAnimatorAnimating() condition, which disabled painting, since the animation thread just updates the source image. NEWT WindowImpl: When reparenting back to parent and 'refit' child if it's size exceeds it's parent. More 'Fix: Memory consumption' commit 6ced17f0325d5719e992b246ffd156e5b39694b4. NEWTEvent: Removed code to evaluate the 'system event' attribute, need to find a better approach.
* Harmonize all runtime properties, see doc/Implementation/runtime-properties.txtSven Gothel2010-10-112-3/+2
|
* JOGL: WindowsWGLDrawableFactory/X11GLXDrawableFactory: synchronize ↵Sven Gothel2010-10-092-70/+71
| | | | | | | sharedContext lock/release Unsynchronized lead to an 'context already locked by another thread' exception at initialization time (Windows: in general; X11: ATI and pbuffer drawable).
* NativeWindow/NativeSurface Refactoring ; Added mouseClick NEWT/AWT unit testSven Gothel2010-10-0611-72/+74
| | | | | | | | | | | | | | | | | | | | | | | | | NativeWindow/NativeSurface Refactoring - Using NativeSurface interface - NativeWindow extends NativeSurface, adds getLocationOnScreen(Point) - NativeWindow add: getParent() - NativeWindow/Surface: Removed 'invalidate()', use 'destroy()' if you must. - NullWindow -> ProxySurface impl NativeSurface - JOGL: Uses NativeSurface only. - GLDrawable.getNativeWindow() -> GLDrawable.getNativeSurface() Added mouseClick NEWT/AWT unit test JOGL: - GLAnimatorControl add: resetCounter() - NEWT: - GLWindow counters: return GLWindow counters always - WindowImpl - requestFocus() wait until done - reparent: readded requestFocusImpl(true), native impl skips java focusAction if reparented - X11Window: Add XRaiseWindow() in requestFocus()
* Misc CleanupsSven Gothel2010-09-151-5/+3
| | | | | | | | - www/index.html: absolute local refs -> relative - Platform GLContextImpl specialisations: remove local overriding drawable instance - X11ExternalGLXDrawable: Remove dead code, left over.
* Removed COPYRIGHT.txt file, whichSven Gothel2010-09-141-25/+26
| | | | | | | | | | | | | | | | | | | | | | | is redundant due to COPYRIGHT notice in LICENSE.txt. It's product usage terms are no more applicable, since our repository is not used by Sun Microsystems to deliver a product. LICENSE.txt changes: - Updated SGI FreeB license reference from 1.1 to 2.0 - Dropped Sun alternative license, which is redundant due to the FreeB 2.0 license. - Added JogAmp Community and common denominator: New BSD 3-clause license README: - Added contacts - Sun -> JogAmp - Added Michael Bien Changed 'Sven Gothel' and 'Michael Bien' New BSD 3-clause license to 'JogAmp Community' Simplified BSD 2-clause license.
* Fix file modesSven Gothel2010-07-072-0/+0
|