Commit Graph

1034 Commits

Author SHA1 Message Date
Sergey Sharybin
94fdaa5d41 Fix crash starting game engine on linux
Issue was caused by bug in mesa #54080 which makes
glXQueryDrawable fail with GLXBadDrawable for any
request with direct context.

Worked around by temporary overriding X error handling
when getting old interval value and disablingintervals
extension if this query fails.

Also added check for glXSwapIntervalEXT which is
apparently NULL here with GLX_EXT_swap_control=1.
2013-10-03 13:15:53 +00:00
Jens Verwiebe
be20171f39 OSX/GHOST: fix own issue in 60510, should now (hopefully) cover all multiple window combinations 2013-10-02 19:54:24 +00:00
Brecht Van Lommel
e308c2f166 Fix #36316: dots in cycles render on certain CPUs with 32 bit linux builds.
There is some sort of problem with the SSE2 code path, but I couldn't find
the cause, maybe a compiler bug due to the large amount of inlining? For
now I've disabled SSE2 optimizatons in 32 bit GCC builds.
2013-10-02 19:00:16 +00:00
Jens Verwiebe
8686f9fe03 OSX/GHOST: refine #60409 and better take multiple windows into account 2013-10-02 18:49:32 +00:00
Brecht Van Lommel
15e5d3ef7b Fix #36891: on OS X, cmd+s or cmd+o did not work when pressing them over the
text editor.
2013-09-30 19:58:56 +00:00
Campbell Barton
3407a2e145 name cocoa functions in keeping with convention with similar functions for other ghost classes. 2013-09-29 13:14:09 +00:00
Jens Verwiebe
d528b4c9bb OSX: more descriptive comment 2013-09-29 10:11:49 +00:00
Jens Verwiebe
20053f4954 OSX: cleanup for 60409, let m_window protected and use rather a public function for getting it public 2013-09-29 10:00:34 +00:00
Jens Verwiebe
1a30e52142 OSX: make sure closing the mainwindow forewards to the quitdialog - todo: check if m_window now public is a problem 2013-09-28 17:55:22 +00:00
Campbell Barton
aa8488421f style cleanup: whitespace & odd indentation 2013-09-21 10:46:58 +00:00
Jens Verwiebe
50fbb6c07e OSX/scons: fix linking errors due bf_intern_ghostndof3dconnexion was build even if no 3Dmouseware was detected 2013-09-20 18:52:39 +00:00
Bastien Montagne
8b093329ff Fix [#36742] Pasting image into text editor causes freeze
Last fallback (XCLIB_XCOUT_FALLBACK_TEXT) was not checked, hence infinitly looping...
2013-09-16 18:14:04 +00:00
Campbell Barton
811669c14e minor style clanup and use more meaningful name for 3DCONNEXION source code. 2013-09-14 12:04:10 +00:00
Jens Verwiebe
e05fc7bb2f Cleanup for last commit 2013-09-13 21:42:52 +00:00
Jens Verwiebe
c446015974 Fix broken compiling with ndof on linux and win 2013-09-13 21:21:53 +00:00
Jens Verwiebe
3596ab932c OSX: Compilefix for ndof symbols get magled when used extern C, now use discrete c files embedded, patch by Jake Kauth 2013-09-13 15:18:17 +00:00
Nathan Letwory
8309f1c0de Fix for [#36707] Blender Opens in fullscreen and stays like that
Reported by holy enigma

The previous commit in this area removed bounding box checks, because
they were done against primary monitor. Now do bound checks against
the entire desktop, or rather, the virtual screen. This is the bounding
rectangle of all the monitors.

This should ensure windows are always created within the confines of this
area.
2013-09-12 10:44:03 +00:00
Nathan Letwory
d396bd92ee Fix [#36702] blenderapplication window position and size
On Windows the system window will be sized an positioned such that Blender screen area lower left
corner is at the requested location, and with dimension as requested.

Thanks to Alexander N. for reporting and Brecht van Lommel for input.
2013-09-11 14:14:18 +00:00
Campbell Barton
f81f6c5019 take the decender into account when drawing console text.
also add data types wm and mask to dataname() and unshadow var in ghost/x11
2013-09-11 04:14:27 +00:00
Campbell Barton
43c83e2458 fix double free in ghost c++ gears test program. 2013-09-11 01:15:13 +00:00
Nathan Letwory
46db99e7fd Remove dimension checks from window creation.
This should be (and is) done by the caller instead (windowmanager)
to ensure new windows fit properly on the desktop. Saving
stretched layouts and layouts with window over display 
boundaries now becomes possible on Windows too.
2013-09-10 06:35:50 +00:00
Campbell Barton
4320a7c9df fix for bug in GHOST/SDL, events dont always have a window (which ghost needs).
fallback to the window with the active opengl context.
2013-09-06 01:40:20 +00:00
Sergey Sharybin
be42cd54df Ghost test application could be compiled again
Was an IRC request to have Ghost application up
and running for investigation purposes.
2013-09-05 16:22:07 +00:00
Campbell Barton
90b9fa3608 fix [#36459] Official blenderplayer can not go fullscreen on Linux
use modified patch from Alex Fraser (z0r)
2013-09-04 23:43:25 +00:00
Mitchell Stokes
42deb95583 Ghost_SDL: Fixing the DEF_CURSOR macro so it works in release builds. 2013-09-04 21:57:14 +00:00
Nathan Letwory
d5fba56b38 Add new cursor types to data handling to account for Intuos 4 device (pen and eraser).
Thanks to Ayden Polat for helping to find out the cursor type codes.
2013-09-04 12:10:02 +00:00
Alexander Kuznetsov
a3410a1b47 Fixed crash on Visual Studio 2013-09-03 15:30:07 +00:00
Mitchell Stokes
07e655dfa6 Cleaning up some prints related to SDL. 2013-08-29 22:48:37 +00:00
Mitchell Stokes
d4eeca430d Adding support for enabling/disabling vsync to Ghost_SDL. 2013-08-29 22:48:31 +00:00
Sergey Sharybin
ba6b83d63d Get rid of PATH_MAX in Ghost System X11
The reason of this is because PATH_MAX is not guaranteed
to be defined on all platforms and Hurd doesn't define it.

So either we need to support arbitrary long file path or
we need to define own maximum path length.

The rule here would be:

- If it's not big trouble to support arbitrary long paths
  (i.e. in ghost by using std::string instead of char*)
  then arbitrary long path shall be implemented.

- For other cases to use PATH_MAX please include BLI_fileops.h
  which takes care of making sure PATH_MAX is defined.

Additional change: get rid of own changes made yesterday
which were supposed to make storage.c work fine in cases
PATH_MAX is not define, but on the second though it lead
to unneeded complication of the code.

Thanks Campbell for review!
2013-08-20 08:33:04 +00:00
Campbell Barton
47c23750e8 style cleanup: indent/whitespace 2013-08-19 01:48:44 +00:00
Antony Riakiotakis
ac8e379a87 Fix linking issue, we use bundled static glew so we should define static glew in ghost as well. 2013-07-31 22:39:17 +00:00
Mitchell Stokes
29f8dfd37a BGE: Adding vsync control. Users can enable vsync, disable vsync, or use adaptive vsync via UI options in the render properties, or by using the new Python method bge.render.setVsync(). Win32 and X11 support are done via EXT_swap_control. Support for using EXT_swap_control on OS X still needs to be added to Ghost. 2013-07-29 22:31:32 +00:00
Campbell Barton
824ec5a388 code cleanup: case & brace placement 2013-07-19 10:40:43 +00:00
Campbell Barton
cbe43fd385 code cleanup: pass event by pointer to getClipboard_xcout 2013-07-19 10:40:27 +00:00
Campbell Barton
a15ac6ee09 code cleanup: use bool for widget struct, also edit odd strncpy use. 2013-07-19 10:39:44 +00:00
Campbell Barton
b1403415ae fix [#36157] Memory Leak in GHOST_DropTargetX11
would leak a little bit of memory for every window created.
2013-07-16 05:10:58 +00:00
Brecht Van Lommel
c776d5e003 Fix #35904: on Windows force NVidia Optimus, which does automatic graphics
switching between an integrated Intel and a dedicated NVidia card, to use the
dedicated card for Blender.

A more portable and general solution would be nice, but it's all I could find:
http://developer.download.nvidia.com/devzone/devcenter/gamegraphics/files/OptimusRenderingPolicies.pdf
2013-06-28 17:58:48 +00:00
Brecht Van Lommel
b466a5c9a9 Fix #35890: memory leak in OS X ghost locale detection. 2013-06-27 13:24:55 +00:00
Campbell Barton
225c5fee6b move BLO_sys_types.h -> BLI_sys_types.h (it had nothing todo with loading)
remove MEM_sys_types.h which was a duplicate.
2013-05-28 19:35:26 +00:00
Alexander Kuznetsov
60befcdc62 Fix for r35524. Thanks Jeffrey Hoover for reporting.
WM_SIZE is dispatched before full init.
2013-05-28 18:36:47 +00:00
Alexander Kuznetsov
b9817cd207 Live resize on Windows. Based on Ton's patch for mac.
Removing old resize stuff. 
Windows has resize lag, which creates black gap with openGL. Still looking to fix it.
2013-05-25 21:59:34 +00:00
Ton Roosendaal
24321d4891 Solving ancient Blender window sizing issue;
- Removed grid-snapping for area coordinates on scaling windows. 
  That caused the areas to shrink or expand, and eventually corrupt screen layouts.

- Added simple but efficient life resize for OSX. I need to know why this is so much
  code for Windows... I suggest Windows to just copy same method; dispatch the queue,
  and just let the event system draw.
2013-05-25 14:08:56 +00:00
Campbell Barton
6de829cb7a code cleanup: split scons includes onto multiple lines, reduce chance of include conflicts later on. 2013-05-20 18:42:28 +00:00
Campbell Barton
6adec303db revert (ifdef) r54745. which enbabled alpha in the GL buffer.
looks to be the cause of bug [#35415]

we can make this optional.
2013-05-19 11:39:22 +00:00
Brecht Van Lommel
423ffa6043 Painting / Sculpting: more tweaks to pressure sensitivity
* Also do pressure interpolation for brush size and spacing.
* Do smoothing of pressure when smooth stroke and sample average is enabled.
* Revert the OS X specific pressure change to pressure ^ 2.5, for low pressure
  values like 0.05 it makes the pressure 100x lower, which is problematic. If
  we need to adjust the pressure curve it should be done for all platforms.

Still weak:

* Pressure of first touch on tablet is difficult to control, usually it's low
  which makes the stroke start out small or soft, but other times not. Finer
  event capturing at ghost level would help, along with pressure changes without
  mouse movement, but this may also need different paint stroke logic.
* Brush radius is rounded to integers, this gives noticeable stepping.
* Brush falloff is not antialiased, gives noticeable aliasing for small brush
  sizes which was always a problem, but is more common with size pressure control.
2013-05-18 11:25:24 +00:00
Brecht Van Lommel
213408d4c9 Fix #35340: 3D manipulator not working right after undoing with cmd+Z on OS X.
Another issue with the recent Ghost changes here. For some reason key up events
are not coming through when the command key is pressed. I can't figure out why,
for now just always handle them, still fixes the original bug.
2013-05-13 21:19:30 +00:00
Jürgen Herrmann
3d3a4e8eec Patch [#35234]:
Fix GetWindowsLon and SetWindowsLong issues with VS2012 and Windows 8.
Remove unneeded #ifdef block for GWL_WNDPROC and GWL_USERDATA
2013-05-13 20:27:05 +00:00
Brecht Van Lommel
5c2355d364 Fix ctrl+(shift)+tab shortcut key not working on OS X after recent bugfix to
interact better with system shortcuts.

This is a special shortcut for switching between views and does not get
delivered directly to our view when we pass it through the application key
event handling path. We only have a single OpenGL view, so there's no need to
pass it on to the application, instead just interpret it directly.
2013-05-12 22:15:05 +00:00
Brecht Van Lommel
f35a9328e0 Fix for previous fix, not sure it will cause issues in practice but better be
sure to avoid invalid memory access.
2013-05-11 12:21:33 +00:00
Brecht Van Lommel
a919b0e4c3 Fix #35265: on OS X, pressing system shortcuts such as cmd+M or cmd+` would both
insert text in the text editor and do the associated operation like minimizing the
window or switching windows.

The code was always doing both without trying to ensure only one is done. Now we
integrate a bit better with the event handling and pass the event to NSApp, which
then decides to handle the event itself or pass it on to the window, from where
we then send it back to be handled.
2013-05-11 10:15:27 +00:00
Brecht Van Lommel
360a86d658 Attempt to fix OS X build with 10.6 SDK, was not working due to recent fullscreen bug fixes. 2013-05-08 19:37:36 +00:00
Brecht Van Lommel
2a4ee23a25 Fix #35225: new OS X Lion fullscreen did not work together well with old
fullscreen option. It was possible to enable both at the same time which got
you stuck in a state where it was impossible to exit fullscreen. Now I've made
them mutually exlusive, only one can be enabled at the same time.

Note the reason we need to support both is because the new Lion fullscreen does
not work with multiple monitors, it will just give black screens on the other
monitors. This is a limitation of OS X, you can find many complaints about this
online.
2013-05-06 13:39:25 +00:00
Brecht Van Lommel
aa2a0e4ab0 More build fixes for visual studio 2012.
Patch #35019, #35131 and #35152 by Jurgen Herrmann.
2013-04-29 19:15:56 +00:00
Francisco De La Cruz
70de23dabb Fix #29932 Left Shift + Numpad 1,2,3 not Aligning to Active
Intermediate Shift+Key messages were resetting modifier flags.
2013-04-25 05:32:32 +00:00
Alexander Kuznetsov
b0f8ece9d9 Forgot disable else and it became: else /* */ break;
Caused a crash on Windows on alt-key when a tablet was plug in.
2013-04-20 16:14:31 +00:00
Alexander Kuznetsov
177080a15d Disabling live resize for Windows for now.
Bug #34990

However, cleanscreen on redraw is still disabled, so when resizing blender will have frozen image.
2013-04-18 13:30:41 +00:00
Antony Riakiotakis
15f3bbfe9e Fix some compilation errors for MinGW. Thanks to vildas on irc for
bringing this to attention.
2013-04-13 16:29:18 +00:00
Thomas Dinges
6f9495fc29 Fix for [#34968] Cross compiling from linux for windows is broken
* Patch by Martijn Berger (juicyfruit).
2013-04-13 09:28:07 +00:00
Jens Verwiebe
84ba3f6521 Fix scons compile after GHOST_Sizer commit 2013-04-09 18:58:01 +00:00
Alexander Kuznetsov
f652b11ed1 Live window resizing on Windows
Custom implementation for resizing (GHOST_SizerWin32)

Some things still don't work:
* esc cancel
* max windows size
* aero (sizing) snap on win7

hbrBackground = 0 to disable clear screen.

Thanks to dfelinto for help in finding of root cause.
2013-04-09 17:21:05 +00:00
Campbell Barton
a4520320ef fix [#34900] Building blender as a python module is broken in trunk
patch provided by reporter - Martijn Berger (juicyfruit)

also quiet warnings for headless mode.
2013-04-08 05:01:35 +00:00
Brecht Van Lommel
9cd197cd82 Fix incorrect OS X warning message in console when using multisample antialiasing
about number of samples not matching the requested number.
2013-04-02 19:18:38 +00:00
Campbell Barton
e1a54214bb code cleanup:
- remove unused defines.
- quiet some shadow warnings.
- bevel, ifdef out some asserts that are too common.
- style
2013-03-25 02:41:30 +00:00
Ton Roosendaal
70702f78b5 OS X Fullscreen: shortcut now is CTRL + Cmd + F. Is more common, and it keeps
Cmd + F for searches.
2013-03-24 14:56:03 +00:00
Campbell Barton
0bc791a34f Unix/X11 - use RGBA icon (netwm icon), rather then pixmap icon. 2013-03-24 06:23:15 +00:00
Ton Roosendaal
c79b923c1d Bug fix 34743
Mac OS X full screen: the old option to go full screen now didn't hide the
dock/topbar anymore. Also made it use dock auto-hide now, not permanent hide.
2013-03-23 16:08:02 +00:00
Jens Verwiebe
a333ef0100 GHOST_Cocoa, let new fullscreen also appear on 10.6 deployed builds 2013-03-22 23:48:26 +00:00
Ton Roosendaal
6690d2abdd OSX feature:
Blender now supports the 10.7+ "Full screen" mode, which pushes a window to a permanent
other "screen", with animated zoom and sliding.

Available via the icon in window header (right), Apple+F, or "Window" menu in top.

Works much nicer than Blender's own "full screen" option.

Todo: the zoom effect is still draws a bit ugly, because Blender doesn't have "live resize"
yet.
2013-03-22 16:11:00 +00:00
Jens Verwiebe
09a604561d OSX/tablet: fix a longstanding bug with certain devices and a cornercases 2013-03-20 16:51:50 +00:00
Jens Verwiebe
a207d76709 OSX/pen: change sensivity graduation to a good value found with Sebastian and remove debug print 2013-03-19 12:29:38 +00:00
Jens Verwiebe
05787db61f OSX/pen: change sensivity graduation so we don't get maximum too early and have more feeling 2013-03-19 11:38:40 +00:00
Campbell Barton
baf3bb37a9 - ghost-sdl builds again.
- without python builds without warnings.
- replace MAXFLOAT -> FLT_MAX in some areas, MAXFLOAT overflows (lager then float range).
- add cmake option WITH_GCC_MUDFLAP to enable libmudflap use.
2013-03-16 20:49:46 +00:00
Ton Roosendaal
bee0af076f Adding include for NULL define in c++ 2013-03-08 09:09:48 +00:00
Campbell Barton
6fd187e4df code cleanup: 0 --> NULL 2013-03-08 06:32:00 +00:00
Jens Verwiebe
f1f702a5ec OSX/locale: fix compile on older xcode by not using toll-free-bridging, which needs ARC 2013-03-03 20:32:27 +00:00
Jens Verwiebe
1c5f18f42b OSX: Get the current locale in objC-style 2013-03-02 22:50:46 +00:00
Dalai Felinto
07cd75d7b0 fix for [#34440] motion blur (2d filter) not working in osx
thanks Jens Verwiebe for the tests and review.
2013-02-27 22:48:34 +00:00
Brecht Van Lommel
4f3ca854e1 Fix various warnings with clang build, and adjust cmake clang warnings flags
to include a few more that gcc is using too.
2013-02-26 21:58:06 +00:00
Campbell Barton
87f1326108 fix for own regression in win32 from r54225, wrong args used in getAllDisplayDimensions()
caused bug [#34391] Window position not saving correctly for next start-up
2013-02-26 09:33:54 +00:00
Campbell Barton
282e5caecf is_crappy_intel_card() was checking strstr(glGetString(GL_VENDOR), "Intel") every call,
better store in static var.
2013-02-25 12:03:26 +00:00
Antony Riakiotakis
99497d1fa2 Hopefully last round of fixes for all OSes 2013-02-24 14:27:59 +00:00
Antony Riakiotakis
08ff355a3a Compile fix round 2. Still trying to do this from linux :p 2013-02-24 14:02:45 +00:00
Antony Riakiotakis
610017d0e8 Add bogus stabs for fullscreen window mode for BGE in GHOST. Platform maintainers should change these to replicate X11 behaviour. Also moved X11 implementation to public methods, just like the IWindow interface. Should fix compilation 2013-02-24 13:51:12 +00:00
Campbell Barton
963b1c1b16 fix for own commit r54806 with argument order and multisampling. 2013-02-24 10:50:33 +00:00
Campbell Barton
630a31a900 fix for fullscreen on X11 (used by the BGE, not blender application),
changing the screen resolution wasn't still allowed for larger virtual desktops.

added an exclusive option to ghost so the fullscreen window is ignored by the window manager and we get all events. (common practice for games on X11).
2013-02-24 05:05:29 +00:00
Campbell Barton
c42b51ed96 GHOST/X11 - free memory allocated by XF86VidModeGetAllModeLines(),
Comment from Zr says this crashes but looks like this was because there was no check if the function failed to allocate to begin with.
2013-02-23 23:15:38 +00:00
Campbell Barton
233b69f0bd GHOST/X11 support for frequency, from SDL's mode switching.
also free the modes when done.
2013-02-23 22:48:16 +00:00
Alexander Kuznetsov
5f830a0863 Applying patch #33709 for dead keys on windows.
Thanks Harley Acheson!
2013-02-22 16:42:19 +00:00
Alexander Kuznetsov
7ae17e9ed4 Fix for windows size on win32 2013-02-22 15:57:50 +00:00
Gaia Clary
b30bdd5cb6 Fixing typos 2013-02-22 09:31:42 +00:00
Dalai Felinto
1cdaf1e329 bge bugfix: [#18967] alpha value is never available in the color buffer by Campbell Barton (X11) and me (Win32)
This is and old patch (June, 2009). The reason it never made into trunk it's that we (me at least) thought that
it should be optional, as a ui or command-line option.

However, it seems that OSX always have the OpenGL context with alpha enabled. So I think it's consistent to
have the other OSs to follow.

The main usage of this is the BGE (or more specifically people using BGE for TV broadcasting) but I think
pydevs can have their share of fun with it in Blender as well.
2013-02-22 07:37:17 +00:00
Campbell Barton
091d86b9cb style cleanup: 'sizeof foo' --> 'sizeof(foo)', add check in style checking script. 2013-02-21 17:18:27 +00:00
Campbell Barton
0528162eb6 patch [#34320] Cross compiling with mingw-w64 on ubuntu
from Martijn Berger (juicyfruit)

applying since this is only corrects header case which is ignored on windows anyway.
2013-02-19 12:05:38 +00:00
Campbell Barton
fb01dcea5f move atoms into their own struct and make all names match the original atom names, there were too many and mixed in with the classes namespace. 2013-02-11 09:30:04 +00:00
Campbell Barton
53bce285ab patch [#31636] no pressure with Genius Mousepen i608X tablet
from Viktoria S. (viktorias)
2013-02-11 08:16:32 +00:00
Campbell Barton
2005f7c6c0 style cleanup: also some typos 2013-02-11 00:49:00 +00:00
Campbell Barton
52df65b137 building ghost-sdl works again. 2013-02-08 08:02:05 +00:00
Campbell Barton
76b7afd909 removing xinerama on X11 dependency, this wasn't working very usefully. 2013-02-07 14:10:01 +00:00
Campbell Barton
2c1219dc17 enable xinerama for scons. 2013-02-06 01:28:56 +00:00