implement the recently introduced setSyncToVBlank-method.
Additionally I added a ToggleSyncToVBlank-eventhandler to osgViewer. I
used it to test the code, perhaps you'll find it useful and include it
in the distribution."
/** Get the file name which represents the archived file.*/
virtual std::string getArchiveFileName() const = 0;
/** return type of file. */
virtual FileType getFileType(const std::string& filename) const = 0;
/** return the contents of a directory.
* returns an empty array on any error.*/
virtual DirectoryContents getDirectoryContents(const std::string& dirName) const = 0;
Added implementations of these new methods into src/osgPlugins/osga/OSGA_Archive.h src/osgPlugins/osga/OSGA_Archive.cpp
CID 11447: Unchecked dynamic_cast (FORWARD_NULL)
Dynamic cast to pointer "dynamic_cast <struct osg::NodeCallback *>(nc->clone(this))" can return null.
Assigning null: "first" = "dynamic_cast <struct osg::NodeCallback *>(nc->clone(this))".
The clone() implementation is written using macro's so that it always returns the type of Object
being cloned so it's normally safe to assume that a dynamic_cast<> will always return a valid pointer as long
as the new T that involves creates a valid object. However, if the class being cloned doesn't correctly
implement the clone() method then their potential for the dynamic_cast to fail and will return a NULL and will
result in a memory leak of the object of paraent class that the clone would have defaulted to.
I've tightened up the CopyOp.cpp code to check the return type and added better handling of the clone in the
osg::clone() methods so thay don't have any potential mememory leaks and report warnings to OSG_WARN when
problems are encountered. It may be more apporpriate to throw an exception so will need to ponder this
issue further.
CID 11403: Logically dead code (DEADCODE)
After this line, the value of "needspace" is equal to 0.
Assigning: "needspace" = "false".
Technically the report is correct, but the code is just debugging code that was there just in case
the code needed to be reviewed. This code is long since through it's debugging stage so the code
is no longer really worth keeping so I've removed it for cleanness sake.
ID 11667: Uninitialized scalar field (UNINIT_CTOR)
Non-static class member _useVertexAttribAlias is not initialized in this constructor nor in any functions that it calls.
Member variable should have been initialized but this varaible will have always been initialized in later code
before it was used anyway so wouldn't have resulted in a runtime bug.
CID 11414: Logically dead code (DEADCODE)
After this line, the value of "vboMemory" is equal to 0.
Assigning: "vboMemory" = "NULL".
Another case of debugging code paths being picked out. I have chosen to just delete these paths as the code
looks to be working fine and less code is better than more code when it comes to maintenance.
but I've moved this initialization into the constructor to make the code more managable.
CID 11686: Uninitialized scalar field (UNINIT_CTOR)
Non-static class member cnt is not initialized in this constructor nor in any functions that it calls.
Non-static class member maxcnt is not initialized in this constructor nor in any functions that it calls.
Non-static class member phase is not initialized in this constructor nor in any functions that it calls.
code is clean and more mantainable.
CID 11676: Uninitialized scalar field (UNINIT_CTOR)
Non-static class member cancelMode is not initialized in this constructor nor in any functions that it calls.
Non-static class member cpunum is not initialized in this constructor nor in any functions that it calls.
Non-static class member detached is not initialized in this constructor nor in any functions that it calls.
Non-static class member isRunning is not initialized in this constructor nor in any functions that it calls.
Non-static class member stackSize is not initialized in this constructor nor in any functions that it calls.
Non-static class member threadPolicy is not initialized in this constructor nor in any functions that it calls.
Non-static class member threadPriority is not initialized in this constructor nor in any functions that it calls.
Non-static class member uniqueId is not initialized in this constructor nor in any functions that it calls.
CID 11564: Unsigned compared against 0 (NO_EFFECT)
This less-than-zero comparison of an unsigned value is never true. "cpunum < 0U".
CID 11677: Uninitialized scalar field (UNINIT_CTOR)
Non-static class member _minimumNumberAccumAlphaBits is not initialized in this constructor nor in any functions that it calls.
Non-static class member _minimumNumberAccumBlueBits is not initialized in this constructor nor in any functions that it calls.
Non-static class member _minimumNumberAccumGreenBits is not initialized in this constructor nor in any functions that it calls.
Non-static class member _minimumNumberAccumRedBits is not initialized in this constructor nor in any functions that it calls.
CID 11690: Uninitialized scalar field (UNINIT_CTOR)
Non-static class member _frameLastUsed is not initialized in this constructor nor in any functions that it calls.
CID 11689: Uninitialized pointer field (UNINIT_CTOR)
Non-static class member _glBlendColor is not initialized in this constructor nor in any functions that it calls.
CID 11681: Uninitialized scalar field (UNINIT_CTOR)
Non-static class member _previousHeight is not initialized in this constructor nor in any functions that it calls.
Non-static class member _previousWidth is not initialized in this constructor nor in any functions that it calls.
CID 11688: Uninitialized scalar field (UNINIT_CTOR)
Non-static class member _previousHeight is not initialized in this constructor nor in any functions that it calls.
Non-static class member _previousWidth is not initialized in this constructor nor in any functions that it calls.
CID 11687: Uninitialized pointer field (UNINIT_CTOR)
Non-static class member _glBeginEndAdapter is not initialized in this constructor nor in any functions that it calls.
CID 11810: Uninitialized scalar field (UNINIT_CTOR)
Non-static class member _setMaxFarDistance is not initialized in this constructor nor in any functions that it calls.
CID 11811: Uninitialized pointer field (UNINIT_CTOR)
Non-static class member _displayTexturesGroupingNode is not initialized in this constructor nor in any functions that it calls.
CID 11622: Resource leak (RESOURCE_LEAK)
Calling allocation function "operator new(unsigned long long)".
Variable "<storage from new>" is not freed or pointed-to in function "osg::StateSet::StateSet()". [show details]
Assigning: "sharedStateSet" = storage returned from "new osg::StateSet".
282 osg::StateSet* sharedStateSet = new osg::StateSet;
Variable "sharedStateSet" is not freed or pointed-to in function "osg::Object::setDataVariance(osg::Object::DataVariance)". [show details]
CID 11588: Resource leak (RESOURCE_LEAK)
Calling allocation function "operator new[](unsigned long long)".
Assigning: "dataPtr" = storage returned from "new unsigned char[newTotalSize]".
Following are both false positives as the the scope they are in will always assign the object to a ref counted
structure. I've modified the code to use ref_ptr<> to just make it clear that it's underscope, although
this is not strictly neccessary as the code is OK, I introduced this for clarity and robustness in
presence of exceptions.
CID 11586: Resource leak (RESOURCE_LEAK)
Calling allocation function "operator new(unsigned long long)".
Variable "<storage from new>" is not freed or pointed-to in function "osg::VertexBufferObject::VertexBufferObject()". [show details]
Assigning: "vbo" = storage returned from "new osg::VertexBufferObject".
CID 11587: Resource leak (RESOURCE_LEAK)
Calling allocation function "operator new(unsigned long long)".
Variable "<storage from new>" is not freed or pointed-to in function "osg::ElementBufferObject::ElementBufferObject()". [show details]
Assigning: "ebo" = storage returned from "new osg::ElementBufferObject".
Pointer "indices" returned by "this->_vertexAttribList[0ULL].indices.get()" is never used."
Report highlighted the fact that later code wasn't using the indices variable when it should have been, so
potentially a higher impact that the severity suggested by Coverity.
12208 and 12231.
The windowing system specific headers under
include/osgViewer/api/<system> are again installed under
include/osgViewer/api/<system>
Works in recent ubuntu with cmake-2.8.4 and msvc2010 with cmake-2.8.2"
The pvr format which can be used as a wrapper for different compressed and uncompressed formats supports this compression algorithm. The original pvr compression uses the pvrtc format. The handling of pvrtc is already implemented in the pvr plugin. PVR provides wrapper functionality for some formats, e.g. etc or even dxt/dds.
Our target system (gles2) is able to use the etc compression format. With minor changes in the submitted files, there is no need to write a separate plugin. However the original pvr texture compression formats are not supported on our target, which is the reason for this extension.
The changes mainly consist in the definition on new enum values in the classes and headers of ReaderWriterPVR,Image and Texture. I also found some locations where the handling of the original pvr textures was not implemented. These are also part of this submission."
I also fixed the vsync implementation introduced with rev.11357 that was crashing with the Windows Error #170. So I removed your temporary /* */ around the vsync condition..."
That is, it calls ::wglCreateContext to create a context, not the member method createContextImplementation(), which takes into an account the Traits.
In my situation, this prevents a GL 3.x context from being created.
"
2nd - Script to use a 3rd party directory with basic libraries: libjpeg,libpng,libtiff,giflib,freetype,curl,gdal.
3rd - Change in the GLES library loading for Android. That should make GLES2 work properly.
4rth- Included two defines RGB8_OES and RGBA8_OES as a substitute in GLES for RGB8 and RGBA8
5th - OpenGL and GLSL version identification changed to recognize GLES versions properly
"
of empty node:
if (GetFloat4Param(cot->getParam()->getRef(), f4)) {...}
in the model I have tested cot->getParam()->getRef() return 0x0 and make
it crahes inside GetFloat4Param.
I have added a test before calling GetFloat4Param
if (cot->getParam()->getRef() != 0 &&
GetFloat4Param(cot->getParam()->getRef(), f4)) {...}
"
enum DeviceOrientation{
PORTRAIT_ORIENTATION = 1<<0,
PORTRAIT_UPSIDEDOWN_ORIENTATION = 1<<1,
LANDSCAPE_LEFT_ORIENTATION = 1<<2,
LANDSCAPE_RIGHT_ORIENTATION = 1<<3,
ALL_ORIENTATIONS = PORTRAIT_ORIENTATION | PORTRAIT_UPSIDEDOWN_ORIENTATION | LANDSCAPE_LEFT_ORIENTATION | LANDSCAPE_RIGHT_ORIENTATION
};
typedef unsigned int DeviceOrientationFlags;
The main motivation for this is to easily allow the user to specifiy that the device is in a horizontal orientation rather then having to rotate the view matrix. All flags have been tested individually as well as in combinations. The default is ALL_ORIENTATIONS to keep the exiting functionality for anyone who hasn't specified WindowData for their context traits.
"
external applications can determine if an archive extension is valid.
The second change is a bug fix in Registry::read(const ReadFunctor&)
where if you pass in valid options they get wiped out after the archive
is loaded but before being passed along to the plugin."
that the windows did not act on repaint request (WM_PAINT, EXPOSE,...)
Detailed explanation:
- I implemented requestRedraw using the push approach (not using
GraphicsWindow::_requestRedraw flag that I was considering) as there may be
multiple viewers reading the flag and fighting to reset it after the paint
request, while some viewers may not spot the request to redraw
- I made windows call GraphicsWindow::requestRedraw when they receive
appropriate message (WM_PAINT, EXPOSE, RESIZE,...)
- There were issues on Linux that windows did not want to close using x
button. Resolved by moving the test for DeleteWindow event from
swapBuffersImplementation() to GraphicsWindowX11::checkEvents(). The difficulty
was that DeleteWindow event is not coming using _eventDisplay, but through
_display.
- The last difficulty was that it is necessary to call
ViewerBase::checkWindowStatus() to set _done to true when all windows are
closed. This did not happened recently in ON_DEMAND run scheme. I put the call
to checkWindowStatus() to eventTraversal.
"