Commit Graph

5310 Commits

Author SHA1 Message Date
Robert Osfield
8820d0bb1d Added realize of new graphics contexts to handle new views being added with
unrealized windows
2008-06-28 16:59:26 +00:00
Robert Osfield
fec2a8fabe Changed back to use an std::vector<> rather than a std::list for RequestQueue to
avoid member template problems under Solaris.
2008-06-27 19:40:52 +00:00
Robert Osfield
a9b05e0815 Refactored the sort of the requestQueue so that there is single code path for doing the sort. 2008-06-27 18:59:27 +00:00
Robert Osfield
214491dd94 From Mathias Froehlich, "Update to the configure check for msvc 7.1.
MemoryBarrier() is used in the implementation, so it should be checked.
This in effect disables the faster atomic ops on msvc 7.1 and older, even if
only the MemoryBarrier() call is missing. But it ensures for the fist cut
that it will build everywhere. If somebody cares for msvc 7.1 enough and has
one for testing installed, he might provide the apropriate defines to guard
that MemoryBarrier() call.

I tested that msvc8 32/64bit still passes the configure tests and compiles.
"
2008-06-27 16:47:43 +00:00
Robert Osfield
34f58482e6 Moved the apply(&) default implementations from the header into the NodeVisitor.cpp,
and changed the casts to use static_cast<>.
2008-06-27 12:35:56 +00:00
Robert Osfield
6d53566654 Updated wrappers 2008-06-26 19:21:54 +00:00
Robert Osfield
8dc1143263 From Paul Martz, "The method IntersectionVisitor::apply(osg::PagedLOD&) appears to attempt to identify a "highest res" child of the PagedLOD and only allow intersection on that child. The implementation appears to be flawed in two cases:
1) The "highest res" child is assumed to be the child with index "getNumFileNames()-1" or "getNumChildren()-1". As a result, PagedLODs that do not sort children from furthest to nearest will intersect with the wrong child. (see attached "case1.osg" to reproduce this problem.)
 
2) The code assumes there is only one highest res child. As a result. PagedLODs with multiple children at the same highest res range can only intersect one of those children. ("case2.osg" demonstrates this issue; you can only pick the quad on the right.)
 
I've attached a modified IntersectionVisitor.cpp that attempts to resolve these issues. It identifies a highest res range based on the range mode, then continues traversal on all valid children corresponding to that range description. Only in the case of a malformed PagedLOD does the code fall back to getting the last child in the list.
 "
2008-06-26 18:34:01 +00:00
Robert Osfield
f523515aed From Morten Haukness, "When cloning effects osg crashes because the copy constructur tries to run av pure virtual method (setUpEmitterAndProgram). The right thing to do when cloning an effect is to run the inherited version og buildEffect and setUpEmitterAndProgram.
"
2008-06-26 18:06:24 +00:00
Robert Osfield
44c125a801 Changed the removeCamera() method so that it now actively calls releaseGLObjects()
on all children of a camera that aren't shared with other cameras on that context.

This change fixes problems with allocating and deleting views.
2008-06-26 16:45:50 +00:00
Robert Osfield
53636db5bc From Mathias Froehlich, updated CMakeLists.txt to build the Atomic.cpp 2008-06-26 15:06:44 +00:00
Robert Osfield
260d0d384f From Mathias Froehlich, build fixes for various unices 2008-06-26 12:08:37 +00:00
Robert Osfield
c32ee85d3d From Mathias Froehlich, added do not edit comments to Config.in so that the autogenerated
Config files have an appropriate warning notice
2008-06-26 10:33:47 +00:00
Robert Osfield
5a4ce5a387 From Mathias Froechlich, "Attached is a change to that atomic stuff to move the win32, msvc
implementation of the atomic increment and decrement into a implementation
file.
This way inlining and compiler optimization can no longer happen for these
implementations, but it fixes compilation on win32 msvc targets. I expect
that this is still faster than with with mutexes.

Also the i386 gcc target gets atomic operations with this patch. By using an
implementation file we can guarantee that we have the right compiler flags
available."
2008-06-26 10:27:16 +00:00
Robert Osfield
87b74c1f54 Commented out the explict install of the Config files as including these files into
the header list allows the normal Cmake install support to install them.
2008-06-23 10:18:04 +00:00
Robert Osfield
275811d02a From Eric Sokolowsky, "I have made a number of changes intended to get a few things working better on OSX. However, since I'm still pretty new at Mac development and cmake I'm not entirely certain that the changes I have made are benign on other platforms. I have tested these changes on Leopard with CMake 2.6 generating Xcode 3.0 projects, compiling on ppc and i386 for 10.5 and 10.4, and on Linux (CentOS) and everything still seems to work ok. Here are the changes I made (against OSG svn as of this afternoon):
- Added osgviewerCocoa example to APPLE builds
- Fixed corrupt Xcode project generation with CMake 2.6 dealing with ADD_DEFINITIONS and CMake Policy CMP0005 on Leopard
- Resolved CMP0006 warning for examples and programs by setting BUNDLE DESTINATION to same as RUNTIME DESTINATION with CMake 2.6
- Fixed freetype plugin on Leopard to avoid OpenGL linking problem
- Figured out how to use a custom Info.plist included in the project (see osgviewerCocoa application CMakeLists.txt)"
2008-06-23 09:57:45 +00:00
Robert Osfield
1e3183a355 Quietened down debug info 2008-06-21 17:56:38 +00:00
Robert Osfield
af271f99ec Added support for X11's overrideRedirect functionality 2008-06-21 17:50:58 +00:00
Robert Osfield
415d45525c Changed the include/osg/Config and include/OpenThreads/Config references to use the assocaited CMake variable for these headers 2008-06-20 19:52:14 +00:00
Robert Osfield
ff811736fc From Terry Welsh, added missing MixinVector header 2008-06-20 17:32:27 +00:00
Robert Osfield
779a7c46ac Added OSG_WINDOWING_SYSTEM cmake option string to allow toggling between X11 and Carbon under OSX. 2008-06-20 16:57:22 +00:00
Robert Osfield
a71939c5bb From Mathias Froehlich, moved optional config variables into include/osg/Config file that
is automatically created by cmake according to its own settings.
2008-06-20 15:50:53 +00:00
Robert Osfield
8aa7c330f8 Changed const double* to const Matrix::value_type* to ensure changes in Matrix type don't break the build 2008-06-20 15:28:38 +00:00
Robert Osfield
be185cb3af From Terry Welsh, new flatten static transforms visitor that duplicates subgraphs that are shared beneath differnt static transforms
From Robert Osfield, made a range of changes to Terry's visitor integrating it into osgUtil::Optimizer and 
changing the code to use a style more like the rest of the OSG.
2008-06-20 13:16:35 +00:00
Robert Osfield
bc6e5b5da2 Updated version numbers for dev releases 2008-06-20 11:11:47 +00:00
Robert Osfield
0e7920f144 From Mathias Froehlich, "Fixes a compile of src/osgSim/ShapeAttribute.cpp on suse 10.2." 2008-06-20 10:46:33 +00:00
Robert Osfield
96a80666c9 Updated wrappers 2008-06-19 20:42:10 +00:00
Robert Osfield
d6469b87c1 From Mathieu Marache, "submission for inclusion to support mpg and avi files when using the quicktime plugin on windows" 2008-06-19 17:35:45 +00:00
Robert Osfield
936edacc92 From Mathias Froehlich, added support for using OpenThreads::Atomic for thread safe ref/unref. 2008-06-19 17:30:38 +00:00
Robert Osfield
2ba5f002d2 from Andrew Bettison, LineStipple support for .ive 2008-06-19 14:57:36 +00:00
Robert Osfield
0faaf93dc2 From Adrian Egli, "Improvements to the PSSM implementation" 2008-06-19 14:45:54 +00:00
Robert Osfield
cc9d12f34f From Rudolf Weidemann, "in the OpenFlight format materials can have editable names.
In the OSG OpenFlight plugin these names are ignored when reading, and
empty strings are written.

As we need these names in the OSG scene graph by our application, I
changed the plugin code, so the names are now stored in class
"osg::Material" (derived from "osg::Object") by
 material->setName();
(see "PaletteRecords.cpp, line 195) when reading the file, and written
to file by
 dos.writeString( m.Material->getName(), 12 );
(see MaterialPaletteManager.cpp, line 80).

As these names otherwise get lost when reading an OpenFlight file and
writing it again e.g. by
 osgconv example.flt converted_example.flt
these changes make the plugin more complete.

The changes were made to OSG revision 8425, and were tested by
 osgconv example.flt converted_example.flt
comparing the material palettes of both files inside Multigen Creator."
2008-06-19 14:35:18 +00:00
Robert Osfield
dd13893861 From Farshid Lashkari, "I noticed some problems when setting up CameraNodes that inherit
viewport settings in stereo mode. It seems that the SceneView::cull()
method will pass the full size viewport to the left/right
cullvisitors, instead of the modified stereo viewport. I made quite a
few changes to SceneView to fix the issue. The SceneView::cullStage()
method will now receive the viewport as an argument, instead of using
the global viewport. The SceneView::cull() method will pass the
modifed viewport to cullStage when rendering in stereo.

There are 2 new private methods computeLeftEyeViewport() and
computeRightEyeViewport() that will compute the stereo viewports. I
also modified the draw() function so it applies the correct viewport
to the prerender stages. These changes are only necessary for
horizontal/vertical split stereo."
2008-06-19 14:29:38 +00:00
Robert Osfield
c3c727b822 From Andrew Bettison, "Attached are changes for src/osgPlugins/ive (version 2.4.0) that implement LineStipple read/write support for the ive file format." 2008-06-19 14:14:20 +00:00
Robert Osfield
4c9b3de4a1 Updated wrappers to fix OpenThreads::Atomic build issues. 2008-06-19 13:28:33 +00:00
Robert Osfield
174f9bbfe0 From Michael Platings and Robert Osfield, added support for controlling,
via StateSet::setNestedRenderBin(bool) whether the new RenderBin should be nested
with the existing RenderBin, or be nested with the enclosing RenderStage.
2008-06-19 11:09:20 +00:00
Robert Osfield
0abf539b60 Updated wrappers 2008-06-18 20:27:06 +00:00
Robert Osfield
f06d50a7eb From Michael Platings, implemented check against max number of supported samples to ensure that the number of samples is safely capped to what the hardware is capable of, avoiding GL errors and graceful fallback 2008-06-18 20:24:12 +00:00
Robert Osfield
45fcb25765 From Liang Aibin:
"1. Location: <OSG_SOURCE_ROOT>\src\osgPlugins\osg\Fog.cpp
   Reason: ".osg" writter plugins output incorrected string for osg::Fog's Mode.
   How to Fix:
     Line 138 in Fog.cpp: case(Fog::LINEAR): return "NERVER";
     Change to:           case(Fog::LINEAR): return "LINEAR";
2. Location: <OSG_SOURCE_ROOT>\src\osgPlugins\ive\
   Reason: ".ive" writter plugins missing to process "osg::Fog".
   How to Fix:
   (1). Line 86 in ReadWrite.h:
        Add: #define IVEFOG                          0x00001133
   (2). In CMakeLists.txt
        "SET(TARGET_SRC" section Add: Fog.cpp
        "SET(TARGET_H" section Add: Fog.h
   (3). In DataInputStream.cpp
        Line 54,Add:    #include "Fog.h"
        Line 1185,Add:  else if(attributeID == IVEFOG){
                            attribute = new osg::Fog();
                            ((ive::Fog*)(attribute))->read(this);
                        }
   (4). In DataOutputStream.cpp
        Line 57,Add:    #include "Fog.h"
        Line 832,Add:   // This is a Fog
                        else if(dynamic_cast<const osg::Fog*>(attribute)){
                            ((ive::Fog*)(attribute))->write(this);
                        }
   (5). Add newly created ive::Fog Object in Fog.h and Fog.cpp.
"
2008-06-18 20:17:13 +00:00
Robert Osfield
0a0034aebb Updated wrappers 2008-06-18 16:46:38 +00:00
Robert Osfield
1e5783ece7 Added a wrapString(const char*) which automatically handles null strings. 2008-06-18 16:45:21 +00:00
Robert Osfield
959c01557c Convert string handling to use strdup and free rather then awkward new char[]
code paths
2008-06-18 16:28:52 +00:00
Robert Osfield
90ea0bd95f From Michael Platings and Paul Palumbo, multi-sample FBO support 2008-06-18 14:09:11 +00:00
Robert Osfield
7bef1bd16a From Jean-Sebastien Guay, "When copying a node that had uniforms on it, the copy constructor of osg::Uniform would not copy the array of the original uniform (either _intArray or _floatArray) because none had been allocated and the copy constructor checks that *both* this's array and rhs's array are valid.
I added a call to allocateDataArray() if rhs has (at least) one valid array, which should allocate the right array according to the type. Since the type was copied from rhs, it should create the same array as rhs has, so then it should copy the data in the following lines.
"
2008-06-18 12:01:52 +00:00
Robert Osfield
df87106d4b From Bob Kuehne, "added multi-texture support (alpha/trans images)" 2008-06-18 11:56:50 +00:00
Robert Osfield
b82e24b08d Updated wrappers 2008-06-18 11:51:22 +00:00
Robert Osfield
dd137c2442 From Bob Kuehne, "this submission extends the osgViewer::RecordCameraPathHandler to have an optionally-enabled auto-incrementing filename. default behavior is still the same, but there's one new method to enable autoincrementing filenames."
From Robert Osfield, modified the above so that the number increments come after the filename rather than before.
2008-06-18 11:13:51 +00:00
Robert Osfield
bc79df7cd8 From Gino van den Bergen, "Added support for vrml primitive caching" 2008-06-18 10:51:02 +00:00
Robert Osfield
7dc3ad4b5e From David Callu, "fixed bounding box bug" 2008-06-18 10:46:05 +00:00
Robert Osfield
d7e9e5e495 From Mathias Froehlich, OpenThreads::Atomic support 2008-06-17 17:43:59 +00:00
Robert Osfield
7cfe00d3d9 Added overriding of CullSettings::inheritCullSettings() into osg::Camera to
properly inherit the clear colour.
2008-06-16 20:22:16 +00:00