bool JSSecurityPolicy::isCreateAllowed( const JSObjectProxy *prx, const QObject *parent,
                                        const QString &/*clazz*/, const QString &/*name*/ ) const
{
    if ( hasCapability(CapabilityFactory) && isObjectAllowed( prx, parent ) )
        return true;
    if ( hasCapability(CapabilityTopLevel) && (parent == 0) )
        return true;
    return false;
}
예제 #2
0
   /// Reads "size" bytes from the file, and dumps data into "dst".
   /// The number of actual bytes read is returned in bytesRead
   /// @returns The status of the file
   File::Status read(U32 size, char *dst, U32 *bytesRead)
   {
#ifdef DEBUG
      //   fprintf(stdout,"reading %d bytes\n",size);fflush(stdout);
#endif
      AssertFatal(Closed != currentStatus, "File::read: file closed");
      AssertFatal(NULL != handle, "File::read: invalid file handle");
      AssertFatal(NULL != dst, "File::read: NULL destination pointer");
      AssertFatal(true == hasCapability(FileRead), "File::read: file lacks capability");
      AssertWarn(0 != size, "File::read: size of zero");
      
      /* show stats for this file */
#ifdef DEBUG
      //struct stat st;
      //fstat(*((int *)handle), &st);
      //fprintf(stdout,"file size = %d\n", st.st_size);
#endif
      /****************************/
      long lastBytes=0;
      File::Status lastStatus = File::Ok;

      if (Ok != currentStatus || 0 == size) {
         lastStatus = currentStatus;
	  } else
      {
         long *bytes = &lastBytes;
         if ( (*((U32 *)bytes) = x86UNIXRead(*((int *)handle), dst, size)) == -1)
         {
#ifdef DEBUG
            //   fprintf(stdout,"unsuccessful: %d\n", *((U32 *)bytes));fflush(stdout);
#endif
            setStatus();                                    // unsuccessful
            lastStatus = currentStatus;
         } else {
            //            dst[*((U32 *)bytes)] = '\0';
            if (*((U32 *)bytes) != size || *((U32 *)bytes) == 0) {
#ifdef DEBUG
               //  fprintf(stdout,"end of stream: %d\n", *((U32 *)bytes));fflush(stdout);
#endif
               currentStatus = EOS;                        // end of stream
               lastStatus = currentStatus;
            }
         }
      }
      //    dst[*bytesRead] = '\0';
#ifdef DEBUG
      //fprintf(stdout, "We read:\n");
      //fprintf(stdout, "====================================================\n");
      //fprintf(stdout, "%s\n",dst);
      //fprintf(stdout, "====================================================\n");
      //fprintf(stdout,"read ok: %d\n", *bytesRead);fflush(stdout);
#endif

	  // if bytesRead is a valid pointer, put number of bytes read there.
	  if(bytesRead)
         *bytesRead = lastBytes;

      currentStatus = lastStatus;
      return currentStatus;                                    // successfully read size bytes
   }
예제 #3
0
//-----------------------------------------------------------------------------
// Write to a file.
// The number of bytes to write is passed in size, the data is passed in src.
// The number of bytes written is available in bytesWritten if a non-Null
// pointer is provided.
//-----------------------------------------------------------------------------
File::Status File::write(U32 size, const char *src, U32 *bytesWritten)
{
	if (handle != NULL)
	{
	   AssertFatal(Closed != currentStatus, "File::write: file closed");
	   AssertFatal(handle != NULL, "File::write: invalid file handle");
	   AssertFatal(NULL != src, "File::write: NULL source pointer");
	   AssertFatal(true == hasCapability(FileWrite), "File::write: file lacks capability");
	   AssertWarn(0 != size, "File::write: size of zero");

	   if ((Ok != currentStatus && EOS != currentStatus) || 0 == size)
		  return currentStatus;

	   // write bytes to the stream
	   U32 nBytes = fwrite(src, 1, size,(FILE*)handle);

	   // if we couldn't write everything, we've got a problem. set error status.
	   if(nBytes != size)
		  setStatus();

	   // if bytesWritten is a valid pointer, put number of bytes read there.
	   if(bytesWritten)
		  *bytesWritten = nBytes;

	   // return current File status, whether good or ill.
	   return currentStatus;

	}

   AssertFatal(0, "File::write: Not supported on Android.");
   return setStatus();
}
예제 #4
0
//-----------------------------------------------------------------------------
bool FileStream::flush()
{
   AssertWarn(0 != mStreamCaps, "FileStream::flush: the stream isn't open");
   AssertFatal(false == mDirty || BUFFER_INVALID != mBuffHead, "FileStream::flush: buffer must be valid if its dirty");

   // if the buffer is dirty
   if (mDirty)
   {
      AssertFatal(hasCapability(StreamWrite), "FileStream::flush: a buffer without write-capability should never be dirty");
      
      // align the file pointer to the buffer head
      if (mBuffHead != mFile->getPosition())
      {
         mFile->setPosition(mBuffHead, Torque::FS::File::Begin);
         if (mFile->getStatus() != Torque::FS::FileNode::Open && mFile->getStatus() != Torque::FS::FileNode::EndOfFile)
            return(false);
      }

      // write contents of the buffer to disk
      U32 blockHead;
      calcBlockHead(mBuffHead, &blockHead);
      mFile->write((char *)mBuffer + (mBuffHead - blockHead), mBuffTail - mBuffHead + 1);
      // and update the file stream's state
      setStatus();
      if (EOS == getStatus())
         mEOF = true;

      if (Ok == getStatus() || EOS == getStatus())
         // and update the status of the buffer
         mDirty = false;
      else
         return(false);
   }
   return(true);
}
예제 #5
0
FileStream* FileStream::clone() const
{
   Torque::FS::File::AccessMode mode;
   if( hasCapability( StreamWrite ) && hasCapability( StreamRead ) )
      mode = Torque::FS::File::ReadWrite;
   else if( hasCapability( StreamWrite ) )
      mode = Torque::FS::File::Write;
   else
      mode = Torque::FS::File::Read;

   FileStream* copy = createAndOpen( mFile->getName(), mode );
   if( copy && copy->setPosition( getPosition() ) )
      return copy;

   delete copy;
   return NULL;
}
예제 #6
0
//-----------------------------------------------------------------------------
// Flush the file.
// It is an error to flush a read-only file.
// Returns the currentStatus of the file.
//-----------------------------------------------------------------------------
File::Status File::flush()
{
	if (handle != NULL)
	{
	   AssertFatal(Closed != currentStatus, "File::flush: file closed");
	   AssertFatal(handle != NULL, "File::flush: invalid file handle");
	   AssertFatal(true == hasCapability(FileWrite), "File::flush: cannot flush a read-only file");

	   if (fflush((FILE*)handle) != 0)
		  return setStatus();
	   else
		  return currentStatus = Ok;
	}
   AssertFatal(Closed != currentStatus, "File::flush: file closed");
   AssertFatal(buffer != NULL, "File::flush: invalid file buffer");
   AssertFatal(true == hasCapability(FileWrite), "File::flush: cannot flush a read-only file");
   
   return setStatus();
}
예제 #7
0
//-----------------------------------------------------------------------------
// Flush the file.
// It is an error to flush a read-only file.
// Returns the currentStatus of the file.
//-----------------------------------------------------------------------------
File::Status File::flush()
{
    AssertFatal(Closed != currentStatus, "File::flush: file closed");
    AssertFatal(INVALID_HANDLE_VALUE != (HANDLE)handle, "File::flush: invalid file handle");
    AssertFatal(true == hasCapability(FileWrite), "File::flush: cannot flush a read-only file");

    if (0 != FlushFileBuffers((HANDLE)handle))
        return setStatus();                                        // unsuccessful
    else
        return currentStatus = Ok;                                // success!
}
 //-----------------------------------------------------------------------------
 // Flush the file.
 // It is an error to flush a read-only file.
 // Returns the currentStatus of the file.
 //-----------------------------------------------------------------------------
 File::FileStatus File::flush()
 {
     AssertFatal(Closed != currentStatus, "File::flush: file closed");
     AssertFatal(NULL != handle, "File::flush: invalid file handle");
     AssertFatal(true == hasCapability(FileWrite), "File::flush: cannot flush a read-only file");

     if (fsync(*((int *)handle)) == 0)
         return currentStatus = Ok;                                // success!
     else
         return setStatus();                                       // unsuccessful
 }
void DocumentationPlugin::loadCatalogConfiguration(KListView *configurationView)
{
    config->setGroup("Locations");
    QMap<QString, QString> entryMap = config->entryMap("Locations");

    for (QMap<QString, QString>::const_iterator it = entryMap.begin();
        it != entryMap.end(); ++it)
    {
        if (namedCatalogs.contains(it.key())
            && namedCatalogs[it.key()]->isProjectDocumentationItem())
            continue;
        
	config->setGroup("Locations");
        ConfigurationItem *item = new ConfigurationItem(configurationView, this, it.key(),
	    config->readPathEntry(it.key()),
            hasCapability(Index), hasCapability(FullTextSearch));
        config->setGroup("TOC Settings");
        item->setContents(config->readBoolEntry(item->title(), true));
        config->setGroup("Index Settings");
        item->setIndex(config->readBoolEntry(item->title(), false));
        config->setGroup("Search Settings");
        item->setFullTextSearch(config->readBoolEntry(item->title(), false));
    }
}
예제 #10
0
//-----------------------------------------------------------------------------
// Write to a file.
// The number of bytes to write is passed in size, the data is passed in src.
// The number of bytes written is available in bytesWritten if a non-Null
// pointer is provided.
//-----------------------------------------------------------------------------
File::Status File::write(U32 size, const char *src, U32 *bytesWritten)
{
    AssertFatal(Closed != currentStatus, "File::write: file closed");
    AssertFatal(INVALID_HANDLE_VALUE != (HANDLE)handle, "File::write: invalid file handle");
    AssertFatal(NULL != src, "File::write: NULL source pointer");
    AssertFatal(true == hasCapability(FileWrite), "File::write: file lacks capability");
    AssertWarn(0 != size, "File::write: size of zero");

    if ((Ok != currentStatus && EOS != currentStatus) || 0 == size)
        return currentStatus;
    else
    {
        DWORD lastBytes;
        DWORD *bytes = (NULL == bytesWritten) ? &lastBytes : (DWORD *)bytesWritten;
        if (0 != WriteFile((HANDLE)handle, src, size, bytes, NULL))
            return currentStatus = Ok;                            // success!
        else
            return setStatus();                                    // unsuccessful
    }
}
예제 #11
0
//-----------------------------------------------------------------------------
bool FileStream::setPosition(const U32 i_newPosition)
{
   AssertFatal(0 != mStreamCaps, "FileStream::setPosition: the stream isn't open");
   AssertFatal(hasCapability(StreamPosition), "FileStream::setPosition: lacks positioning capability");

   // if the buffer is valid, test the new position against the bounds of the buffer
   if ((BUFFER_INVALID != mBuffHead) && (i_newPosition >= mBuffHead) && (i_newPosition <= mBuffTail))
   {
      // set the position and return
      mBuffPos = i_newPosition;
      
      // FIXME [tom, 9/5/2006] This needs to be checked. Basically, when seeking within
      // the buffer, if the stream has an EOS status before the seek then if you try to
      // read immediately after seeking, you'll incorrectly get an EOS.
      //
      // I am not 100% sure if this fix is correct, but it seems to be working for the undo system.
      if(mBuffPos < mBuffTail)
         Stream::setStatus(Ok);
      
      return(true);
   }
   // otherwise the new position lies in some block not in memory
   else
   {
      if (mDirty)
         flush();

      clearBuffer();

      mFile->setPosition(i_newPosition, Torque::FS::File::Begin);

      setStatus();
      
      if (mFile->getStatus() == Torque::FS::FileNode::EndOfFile)
         mEOF = true;

      return(Ok == getStatus() || EOS == getStatus());
   }
}
예제 #12
0
   /// Writes "size" bytes into the file from the pointer "src".
   /// The number of actual bytes written is returned in bytesWritten
   /// @returns The status of the file
   virtual File::Status write(U32 size, const char *src, U32 *bytesWritten)
   {
      // JMQ: despite the U32 parameters, the maximum filesize supported by this
      // function is probably the max value of S32, due to the unix syscall
      // api.
      AssertFatal(Closed != currentStatus, "File::write: file closed");
      AssertFatal(NULL != handle, "File::write: invalid file handle");
      AssertFatal(NULL != src, "File::write: NULL source pointer");
      AssertFatal(true == hasCapability(FileWrite), "File::write: file lacks capability");
      AssertWarn(0 != size, "File::write: size of zero");

      long lastBytes=0;
      File::Status lastStatus = File::Ok;
      
      if ((Ok != currentStatus && EOS != currentStatus) || 0 == size) {
		  lastStatus = currentStatus;
	  } else
      {
         lastBytes = x86UNIXWrite(*((int *)handle), src, size);
         if (lastBytes < 0)
         {
			lastBytes = 0;
            setStatus();
            lastStatus = currentStatus;
         }
         else
         {
            lastStatus = Ok;
         }
      }

	  // if bytesWritten is a valid pointer, put number of bytes read there.
	  if(bytesWritten)
         *bytesWritten = lastBytes;

	  currentStatus = lastStatus;
	  return currentStatus;
   }
예제 #13
0
//-----------------------------------------------------------------------------
// Read from a file.
// The number of bytes to read is passed in size, the data is returned in src.
// The number of bytes read is available in bytesRead if a non-Null pointer is
// provided.
//-----------------------------------------------------------------------------
File::Status File::read(U32 size, char *dst, U32 *bytesRead)
{
    AssertFatal(Closed != currentStatus, "File::read: file closed");
    AssertFatal(INVALID_HANDLE_VALUE != (HANDLE)handle, "File::read: invalid file handle");
    AssertFatal(NULL != dst, "File::read: NULL destination pointer");
    AssertFatal(true == hasCapability(FileRead), "File::read: file lacks capability");
    AssertWarn(0 != size, "File::read: size of zero");

    if (Ok != currentStatus || 0 == size)
        return currentStatus;
    else
    {
        DWORD lastBytes;
        DWORD *bytes = (NULL == bytesRead) ? &lastBytes : (DWORD *)bytesRead;
        if (0 != ReadFile((HANDLE)handle, dst, size, bytes, NULL))
        {
            if(*((U32 *)bytes) != size)
                return currentStatus = EOS;                        // end of stream
        }
        else
            return setStatus();                                    // unsuccessful
    }
    return currentStatus = Ok;                                    // successfully read size bytes
}
 //-----------------------------------------------------------------------------
 // Write to a file.
 // The number of bytes to write is passed in size, the data is passed in src.
 // The number of bytes written is available in bytesWritten if a non-Null
 // pointer is provided.
 //-----------------------------------------------------------------------------
 File::FileStatus File::write(U32 size, const char *src, U32 *bytesWritten)
 {
    // JMQ: despite the U32 parameters, the maximum filesize supported by this
    // function is probably the max value of S32, due to the unix syscall
    // api.
    AssertFatal(Closed != currentStatus, "File::write: file closed");
    AssertFatal(NULL != handle, "File::write: invalid file handle");
    AssertFatal(NULL != src, "File::write: NULL source pointer");
    AssertFatal(true == hasCapability(FileWrite), "File::write: file lacks capability");
    AssertWarn(0 != size, "File::write: size of zero");

    if ((Ok != currentStatus && EOS != currentStatus) || 0 == size)
       return currentStatus;
    else
    {
       S32 numWritten = x86UNIXWrite(*((int *)handle), src, size);
       if (numWritten < 0)
          return setStatus();

       if (bytesWritten)
          *bytesWritten = static_cast<U32>(numWritten);
       return currentStatus = Ok;
    }
 }
예제 #15
0
//-----------------------------------------------------------------------------
// Read from a file.
// The number of bytes to read is passed in size, the data is returned in src.
// The number of bytes read is available in bytesRead if a non-Null pointer is
// provided.
//-----------------------------------------------------------------------------
File::Status File::read(U32 _size, char *dst, U32 *bytesRead)
{
	if (handle != NULL)
	{
	   AssertFatal(Closed != currentStatus, "File::read: file closed");
	   AssertFatal(handle != NULL, "File::read: invalid file handle");
	   AssertFatal(NULL != dst, "File::read: NULL destination pointer");
	   AssertFatal(true == hasCapability(FileRead), "File::read: file lacks capability");
	   AssertWarn(0 != size, "File::read: size of zero");

	   if (Ok != currentStatus || 0 == size)
		  return currentStatus;

	   // read from stream
	   U32 nBytes = fread(dst, 1, size, (FILE*)handle);

	   // did we hit the end of the stream?
	   if( nBytes != size)
		  currentStatus = EOS;

	   // if bytesRead is a valid pointer, send number of bytes read there.
	   if(bytesRead)
		  *bytesRead = nBytes;

	   // successfully read size bytes
	   return currentStatus;
	}

   AssertFatal(Closed != currentStatus, "File::read: file closed");
   AssertFatal(buffer != NULL, "File::read: invalid file buffer");
   AssertFatal(NULL != dst, "File::read: NULL destination pointer");
   AssertFatal(true == hasCapability(FileRead), "File::read: file lacks capability");
   AssertWarn(0 != size, "File::read: size of zero");
   
   if (Ok != currentStatus || 0 == size)
      return currentStatus;
   
   // read from stream
   U32 nBytes = 0;
   
   if ((size-filePointer) > (_size))
   {
   		memcpy(dst, buffer+filePointer, _size);
   		nBytes = _size;
   }
   else if (size-filePointer <= 0)
   {
	    nBytes = 0;
   }
   else
   {
	   memcpy(dst, buffer+filePointer, size-filePointer);
	   nBytes = size-filePointer;
   }

   //Advanced the pointer
   filePointer += nBytes;

   // did we hit the end of the stream?
   if( nBytes != _size)
      currentStatus = EOS;
   
   // if bytesRead is a valid pointer, send number of bytes read there.
   if(bytesRead)
      *bytesRead = nBytes;
     
   // successfully read size bytes
   return currentStatus;
}
예제 #16
0
    void DiGfxCaps::LogCaps()
    {
        DI_INFO("-------------------------");
        DI_INFO("--Graphics capabilities--");
        DI_INFO("-------------------------");

        DI_INFO("GfxDriver: %s", getRenderSystemName().c_str());
        DI_INFO("GPU Vendor: %s", vendorToString(getVendor()).c_str());
        DI_INFO("Device Name: %s", getDeviceName().c_str());
        DI_INFO("Driver Version: %s", getDriverVersion().toString().c_str());

        DI_INFO(" * Hardware generation of mipmaps: %s", _BoolToStr(hasCapability(RSC_AUTOMIPMAP)));
        DI_INFO(" * Anisotropic texture filtering: %s", _BoolToStr(hasCapability(RSC_ANISOTROPY)));
        DI_INFO(" * Hardware stencil buffer: %s", _BoolToStr(hasCapability(RSC_HWSTENCIL)));

        if (hasCapability(RSC_HWSTENCIL))
        {
            DI_INFO("   - Stencil depth: %d", getStencilBufferBitDepth());
            DI_INFO("   - Two sided stencil support: %s", _BoolToStr(hasCapability(RSC_TWO_SIDED_STENCIL)));
            DI_INFO("   - Wrap stencil values: %s", _BoolToStr(hasCapability(RSC_STENCIL_WRAP)));
        }
        DI_INFO(" * 32-bit index buffers: %s", +_BoolToStr(hasCapability(RSC_32BIT_INDEX)));

        DI_INFO(" * Vertex shader: %s", _BoolToStr(hasCapability(RSC_VERTEX_PROGRAM)));
        DI_INFO(" * Number of float constants for vertex shader: %d", mVertexProgramConstantFloatCount);
        DI_INFO(" * Number of int constants for vertex shader: %d", mVertexProgramConstantIntCount);
        DI_INFO(" * Number of bool constants for vertex shader: %d", mVertexProgramConstantBoolCount);

        DI_INFO(" * Fragment shader: %s", _BoolToStr(hasCapability(RSC_FRAGMENT_PROGRAM)));
        DI_INFO(" * Number of float constants for fragment shader: %d", mFragmentProgramConstantFloatCount);
        DI_INFO(" * Number of int constants for fragment shader: %d", mFragmentProgramConstantIntCount);
        DI_INFO(" * Number of bool constants for fragment shader: %d", mFragmentProgramConstantBoolCount);

        DiString profileList = "";
        for(ShaderProfiles::iterator iter = mSupportedShaderProfiles.begin(), end = mSupportedShaderProfiles.end();
            iter != end; ++iter)
        {
            profileList += " " + *iter;
        }
        DI_INFO(" * Supported Shader Profiles: %s", profileList.c_str());

        DI_INFO(" * Texture Compression: ", _BoolToStr(hasCapability(RSC_TEXTURE_COMPRESSION)));
        if (hasCapability(RSC_TEXTURE_COMPRESSION))
        {
            DI_INFO("   - DXT: %s", _BoolToStr(hasCapability(RSC_TEXTURE_COMPRESSION_DXT)));
            DI_INFO("   - VTC: %s", _BoolToStr(hasCapability(RSC_TEXTURE_COMPRESSION_VTC)));
            DI_INFO("   - PVRTC: %s", _BoolToStr(hasCapability(RSC_TEXTURE_COMPRESSION_PVRTC)));
            DI_INFO("   - ATC: %s", _BoolToStr(hasCapability(RSC_TEXTURE_COMPRESSION_ATC)));
            DI_INFO("   - ETC1: %s", _BoolToStr(hasCapability(RSC_TEXTURE_COMPRESSION_ETC1)));
            DI_INFO("   - ETC2: %s", _BoolToStr(hasCapability(RSC_TEXTURE_COMPRESSION_ETC2)));
            DI_INFO("   - BC4/BC5: %s", _BoolToStr(hasCapability(RSC_TEXTURE_COMPRESSION_BC4_BC5)));
            DI_INFO("   - BC6H/BC7: %s", _BoolToStr(hasCapability(RSC_TEXTURE_COMPRESSION_BC6H_BC7)));
        }

        DI_INFO(" * Scissor Rectangle: %s", _BoolToStr(hasCapability(RSC_SCISSOR_TEST)));
        DI_INFO(" * Hardware Occlusion Query: %s", _BoolToStr(hasCapability(RSC_HWOCCLUSION)));
        DI_INFO(" * User clip planes: %s", _BoolToStr(hasCapability(RSC_USER_CLIP_PLANES)));
        DI_INFO(" * VET_UBYTE4 vertex element type: %s", _BoolToStr(hasCapability(RSC_VERTEX_FORMAT_UBYTE4)));
        DI_INFO(" * Infinite far plane projection: %s", _BoolToStr(hasCapability(RSC_INFINITE_FAR_PLANE)));
        DI_INFO(" * Hardware render-to-texture: %s", _BoolToStr(hasCapability(RSC_HWRENDER_TO_TEXTURE)));
        DI_INFO(" * Floating point textures: %s", _BoolToStr(hasCapability(RSC_TEXTURE_FLOAT)));
        DI_INFO(" * Non-power-of-two textures: %s %s", _BoolToStr(hasCapability(RSC_NON_POWER_OF_2_TEXTURES)),(mNonPOW2TexturesLimited ? " (limited)" : ""));
        DI_INFO(" * 1D textures: %s", _BoolToStr(hasCapability(RSC_TEXTURE_1D)));
        DI_INFO(" * 3D textures: %s", _BoolToStr(hasCapability(RSC_TEXTURE_3D)));
        DI_INFO(" * Multiple Render Targets: %d", mNumMultiRenderTargets);
        DI_INFO("   - With different bit depths: %s", _BoolToStr(hasCapability(RSC_MRT_DIFFERENT_BIT_DEPTHS)));
        
        DI_INFO(" * Vertex texture fetch: %s", _BoolToStr(hasCapability(RSC_VERTEX_TEXTURE_FETCH)));
        DI_INFO(" * Number of world matrices: %d", mNumWorldMatrices);
        DI_INFO(" * Number of texture units: %d", mNumTextureUnits);
        DI_INFO(" * Stencil buffer depth: %d", mStencilBufferBitDepth);
        DI_INFO(" * Number of vertex blend matrices: %d", mNumVertexBlendMatrices);

        DI_INFO(" * Render to Vertex Buffer : %s", _BoolToStr(hasCapability(RSC_HWRENDER_TO_VERTEX_BUFFER)));
        DI_INFO(" * Hardware Atomic Counters: %s", _BoolToStr(hasCapability(RSC_ATOMIC_COUNTERS)));

        if (mCategoryRelevant[CAPS_CATEGORY_GL])
        {
            DI_INFO(" * GL 1.5 without VBO workaround: %s"
                , _BoolToStr(hasCapability(RSC_GL1_5_NOVBO)));
            DI_INFO(" * Frame Buffer objects: %s"
                , _BoolToStr(hasCapability(RSC_FBO)));
            DI_INFO(" * Frame Buffer objects (ARB extension): %s"
                , _BoolToStr(hasCapability(RSC_FBO_ARB)));
            DI_INFO(" * Frame Buffer objects (ATI extension): %s"
                , _BoolToStr(hasCapability(RSC_FBO_ATI)));
            DI_INFO(" * PBuffer support: %s"
                , _BoolToStr(hasCapability(RSC_PBUFFER)));
            DI_INFO(" * GL 1.5 without HW-occlusion workaround: %s"
                , _BoolToStr(hasCapability(RSC_GL1_5_NOHWOCCLUSION)));
            DI_INFO(" * Vertex Array Objects: %s"
                , _BoolToStr(hasCapability(RSC_VAO)));
            DI_INFO(" * Separate shader objects: %s"
                , _BoolToStr(hasCapability(RSC_SEPARATE_SHADER_OBJECTS)));
        }

        if (mCategoryRelevant[CAPS_CATEGORY_D3D9])
        {
            DI_INFO(" * DirectX per stage constants: %s", _BoolToStr(hasCapability(RSC_PERSTAGECONSTANT)));
        }
    }
    //-----------------------------------------------------------------------
    void RenderSystemCapabilities::log(Log* pLog)
    {
        pLog->logMessage("RenderSystem capabilities");
        pLog->logMessage("-------------------------");
        pLog->logMessage(
            " * Hardware generation of mipmaps: "
            + StringConverter::toString(hasCapability(RSC_AUTOMIPMAP), true));
        pLog->logMessage(
            " * Texture blending: "
            + StringConverter::toString(hasCapability(RSC_BLENDING), true));
        pLog->logMessage(
            " * Anisotropic texture filtering: "
            + StringConverter::toString(hasCapability(RSC_ANISOTROPY), true));
        pLog->logMessage(
            " * Dot product texture operation: "
            + StringConverter::toString(hasCapability(RSC_DOT3), true));
        pLog->logMessage(
            " * Cube mapping: "
            + StringConverter::toString(hasCapability(RSC_CUBEMAPPING), true));
        pLog->logMessage(
            " * Hardware stencil buffer: "
            + StringConverter::toString(hasCapability(RSC_HWSTENCIL), true));
        if (hasCapability(RSC_HWSTENCIL))
        {
            pLog->logMessage(
                "   - Stencil depth: "
                + StringConverter::toString(getStencilBufferBitDepth()));
            pLog->logMessage(
                "   - Two sided stencil support: "
                + StringConverter::toString(hasCapability(RSC_TWO_SIDED_STENCIL), true));
            pLog->logMessage(
                "   - Wrap stencil values: "
                + StringConverter::toString(hasCapability(RSC_STENCIL_WRAP), true));
        }
        pLog->logMessage(
            " * Hardware vertex / index buffers: "
            + StringConverter::toString(hasCapability(RSC_VBO), true));
        pLog->logMessage(
            " * Vertex programs: "
            + StringConverter::toString(hasCapability(RSC_VERTEX_PROGRAM), true));
        if (hasCapability(RSC_VERTEX_PROGRAM))
        {
            pLog->logMessage(
                "   - Max vertex program version: "
                + getMaxVertexProgramVersion());
        }
        pLog->logMessage(
            " * Fragment programs: "
            + StringConverter::toString(hasCapability(RSC_FRAGMENT_PROGRAM), true));
        if (hasCapability(RSC_FRAGMENT_PROGRAM))
        {
            pLog->logMessage(
                "   - Max fragment program version: "
                + getMaxFragmentProgramVersion());
        }

        pLog->logMessage(
            " * Texture Compression: "
            + StringConverter::toString(hasCapability(RSC_TEXTURE_COMPRESSION), true));
        if (hasCapability(RSC_TEXTURE_COMPRESSION))
        {
            pLog->logMessage(
                "   - DXT: "
                + StringConverter::toString(hasCapability(RSC_TEXTURE_COMPRESSION_DXT), true));
            pLog->logMessage(
                "   - VTC: "
                + StringConverter::toString(hasCapability(RSC_TEXTURE_COMPRESSION_VTC), true));
        }

        pLog->logMessage(
            " * Scissor Rectangle: "
            + StringConverter::toString(hasCapability(RSC_SCISSOR_TEST), true));
        pLog->logMessage(
            " * Hardware Occlusion Query: "
            + StringConverter::toString(hasCapability(RSC_HWOCCLUSION), true));
        pLog->logMessage(
            " * User clip planes: "
            + StringConverter::toString(hasCapability(RSC_USER_CLIP_PLANES), true));
        pLog->logMessage(
            " * VET_UBYTE4 vertex element type: "
            + StringConverter::toString(hasCapability(RSC_VERTEX_FORMAT_UBYTE4), true));
        pLog->logMessage(
            " * Infinite far plane projection: "
            + StringConverter::toString(hasCapability(RSC_INFINITE_FAR_PLANE), true));
		pLog->logMessage(
            " * Hardware render-to-texture: "
            + StringConverter::toString(hasCapability(RSC_HWRENDER_TO_TEXTURE), true));
        pLog->logMessage(
            " * Floating point textures: "
            + StringConverter::toString(hasCapability(RSC_TEXTURE_FLOAT), true));
        pLog->logMessage(
            " * Non-power-of-two textures: "
            + StringConverter::toString(hasCapability(RSC_NON_POWER_OF_2_TEXTURES), true)
			+ (mNonPOW2TexturesLimited ? " (limited)" : ""));
		pLog->logMessage(
            " * Volume textures: "
            + StringConverter::toString(hasCapability(RSC_TEXTURE_3D), true));
		pLog->logMessage(
            " * Multiple Render Targets: "
            + StringConverter::toString(mNumMultiRenderTargets));
		pLog->logMessage(
			" * Point Sprites: "
			+ StringConverter::toString(hasCapability(RSC_POINT_SPRITES), true));
		pLog->logMessage(
			" * Extended point parameters: "
			+ StringConverter::toString(hasCapability(RSC_POINT_EXTENDED_PARAMETERS), true));
		pLog->logMessage(
			" * Max Point Size: "
			+ StringConverter::toString(mMaxPointSize));

    }
void DocumentationPlugin::addCatalogConfiguration(KListView *configurationView,
    const QString &title, const QString &url)
{
    new ConfigurationItem(configurationView, this, title, url, 
        hasCapability(Index), hasCapability(FullTextSearch));
}
예제 #19
0
//-----------------------------------------------------------------------------
bool FileStream::_read(const U32 i_numBytes, void *o_pBuffer)
{
   AssertFatal(0 != mStreamCaps, "FileStream::_read: the stream isn't open");
   AssertFatal(NULL != o_pBuffer || i_numBytes == 0, "FileStream::_read: NULL destination pointer with non-zero read request");

   if (!hasCapability(Stream::StreamRead))
   {
      AssertFatal(false, "FileStream::_read: file stream lacks capability");
      Stream::setStatus(IllegalCall);
      return(false);
   }

   // exit on pre-existing errors
   if (Ok != getStatus())
      return(false);

   // if a request of non-zero length was made
   if (0 != i_numBytes)
   {
      U8 *pDst = (U8 *)o_pBuffer;
      U32 readSize;
      U32 remaining = i_numBytes;
      U32 bytesRead;
      U32 blockHead;
      U32 blockTail;

      // check if the buffer has some data in it
      if (BUFFER_INVALID != mBuffHead)
      {
         // copy as much as possible from the buffer into the destination
         readSize = ((mBuffTail + 1) >= mBuffPos) ? (mBuffTail + 1 - mBuffPos) : 0;
         readSize = getMin(readSize, remaining);
         calcBlockHead(mBuffPos, &blockHead);
         dMemcpy(pDst, mBuffer + (mBuffPos - blockHead), readSize);
         // reduce the remaining amount to read
         remaining -= readSize;
         // advance the buffer pointers
         mBuffPos += readSize;
         pDst += readSize;

         if (mBuffPos > mBuffTail && remaining != 0)
         {
            flush();
            mBuffHead = BUFFER_INVALID;
            if (mEOF == true)
               Stream::setStatus(EOS);
         }
      }

      // if the request wasn't satisfied by the buffer and the file has more data
      if (false == mEOF && 0 < remaining)
      {
         // flush the buffer if its dirty, since we now need to go to disk
         if (true == mDirty)
            flush();

         // make sure we know the current read location in the underlying file
         mBuffPos = mFile->getPosition();
         calcBlockBounds(mBuffPos, &blockHead, &blockTail);

         // check if the data to be read falls within a single block
         if ((mBuffPos + remaining) <= blockTail)
         {
            // fill the buffer from disk
            if (true == fillBuffer(mBuffPos))
            {
               // copy as much as possible from the buffer to the destination
               remaining = getMin(remaining, mBuffTail - mBuffPos + 1);
               dMemcpy(pDst, mBuffer + (mBuffPos - blockHead), remaining);
               // advance the buffer pointer
               mBuffPos += remaining;
            }
            else
               return(false);
         }
         // otherwise the remaining spans multiple blocks
         else
         {
            clearBuffer();
            // read from disk directly into the destination
            bytesRead = mFile->read((char *)pDst, remaining);
            setStatus();
            // check to make sure we read as much as expected
            if (Ok == getStatus() || EOS == getStatus())
            {
               // if not, update the end-of-file status
               if (0 != bytesRead && EOS == getStatus())
               {
                  Stream::setStatus(Ok);
                  mEOF = true;
               }
            }
            else
               return(false);
         }
      }
   }
   return(true);
}
bool JSSecurityPolicy::isPropertyAllowed( const JSObjectProxy *prx,
        const QObject *obj, const char * /*prop*/ ) const
{
    return hasCapability( CapabilityGetProperties|CapabilitySetProperties ) && isObjectAllowed( prx, obj );
}
예제 #21
0
//-----------------------------------------------------------------------------
bool FileStream::_write(const U32 i_numBytes, const void *i_pBuffer)
{
   AssertFatal(0 != mStreamCaps, "FileStream::_write: the stream isn't open");
   AssertFatal(NULL != i_pBuffer || i_numBytes == 0, "FileStream::_write: NULL source buffer pointer on non-zero write request");

   if (!hasCapability(Stream::StreamWrite))
   {
      AssertFatal(false, "FileStream::_write: file stream lacks capability");
      Stream::setStatus(IllegalCall);
      return(false);
   }

   // exit on pre-existing errors
   if (Ok != getStatus() && EOS != getStatus())
      return(false);

   // if a request of non-zero length was made
   if (0 != i_numBytes)
   {
      U8 *pSrc = (U8 *)i_pBuffer;
      U32 writeSize;
      U32 remaining = i_numBytes;
      U32 bytesWrit;
      U32 blockHead;
      U32 blockTail;

      // check if the buffer is valid
      if (BUFFER_INVALID != mBuffHead)
      {
         // copy as much as possible from the source to the buffer
         calcBlockBounds(mBuffHead, &blockHead, &blockTail);
         writeSize = (mBuffPos > blockTail) ? 0 : blockTail - mBuffPos + 1;
         writeSize = getMin(writeSize, remaining);

         AssertFatal(0 == writeSize || (mBuffPos - blockHead) < BUFFER_SIZE, "FileStream::_write: out of bounds buffer position");
         dMemcpy(mBuffer + (mBuffPos - blockHead), pSrc, writeSize);
         // reduce the remaining amount to be written
         remaining -= writeSize;
         // advance the buffer pointers
         mBuffPos += writeSize;
         mBuffTail = getMax(mBuffTail, mBuffPos - 1);
         pSrc += writeSize;
         // mark the buffer dirty
         if (0 < writeSize)
            mDirty = true;
      }

      // if the request wasn't satisfied by the buffer
      if (0 < remaining)
      {
         // flush the buffer if its dirty, since we now need to go to disk
         if (mDirty)
            flush();

         // make sure we know the current write location in the underlying file
         mBuffPos = mFile->getPosition();
         calcBlockBounds(mBuffPos, &blockHead, &blockTail);

         // check if the data to be written falls within a single block
         if ((mBuffPos + remaining) <= blockTail)
         {
            // write the data to the buffer
            dMemcpy(mBuffer + (mBuffPos - blockHead), pSrc, remaining);
            // update the buffer pointers
            mBuffHead = mBuffPos;
            mBuffPos += remaining;
            mBuffTail = mBuffPos - 1;
            // mark the buffer dirty
            mDirty = true;
         }
         // otherwise the remaining spans multiple blocks
         else
         {
            clearBuffer();
            // write to disk directly from the source
            bytesWrit = mFile->write((char *)pSrc, remaining);
            setStatus();
            return(Ok == getStatus() || EOS == getStatus());
         }
      }
   }
   return(true);
}
	//-----------------------------------------------------------------------
	void RenderSystemCapabilities::log(Log* pLog)
	{
#if OGRE_PLATFORM != OGRE_PLATFORM_WINRT
		pLog->logMessage("RenderSystem capabilities");
		pLog->logMessage("-------------------------");
		pLog->logMessage("RenderSystem Name: " + getRenderSystemName());
		pLog->logMessage("GPU Vendor: " + vendorToString(getVendor()));
		pLog->logMessage("Device Name: " + getDeviceName());
		pLog->logMessage("Driver Version: " + getDriverVersion().toString());
		pLog->logMessage(" * Fixed function pipeline: " 
			+ StringConverter::toString(hasCapability(RSC_FIXED_FUNCTION), true));
		pLog->logMessage(
			" * Hardware generation of mipmaps: "
			+ StringConverter::toString(hasCapability(RSC_AUTOMIPMAP), true));
		pLog->logMessage(
			" * Texture blending: "
			+ StringConverter::toString(hasCapability(RSC_BLENDING), true));
		pLog->logMessage(
			" * Anisotropic texture filtering: "
			+ StringConverter::toString(hasCapability(RSC_ANISOTROPY), true));
		pLog->logMessage(
			" * Dot product texture operation: "
			+ StringConverter::toString(hasCapability(RSC_DOT3), true));
		pLog->logMessage(
			" * Cube mapping: "
			+ StringConverter::toString(hasCapability(RSC_CUBEMAPPING), true));
		pLog->logMessage(
			" * Hardware stencil buffer: "
			+ StringConverter::toString(hasCapability(RSC_HWSTENCIL), true));
		if (hasCapability(RSC_HWSTENCIL))
		{
			pLog->logMessage(
				"   - Stencil depth: "
				+ StringConverter::toString(getStencilBufferBitDepth()));
			pLog->logMessage(
				"   - Two sided stencil support: "
				+ StringConverter::toString(hasCapability(RSC_TWO_SIDED_STENCIL), true));
			pLog->logMessage(
				"   - Wrap stencil values: "
				+ StringConverter::toString(hasCapability(RSC_STENCIL_WRAP), true));
		}
		pLog->logMessage(
			" * Hardware vertex / index buffers: "
			+ StringConverter::toString(hasCapability(RSC_VBO), true));
		if(hasCapability(RSC_VBO))
		{
			pLog->logMessage(
				" * 32-bit index buffers: "
				+ StringConverter::toString(hasCapability(RSC_32BIT_INDEX), true));
		}
		pLog->logMessage(
			" * Vertex programs: "
			+ StringConverter::toString(hasCapability(RSC_VERTEX_PROGRAM), true));
		pLog->logMessage(
             " * Number of floating-point constants for vertex programs: "
             + StringConverter::toString(mVertexProgramConstantFloatCount));
		pLog->logMessage(
             " * Number of integer constants for vertex programs: "
             + StringConverter::toString(mVertexProgramConstantIntCount));
		pLog->logMessage(
             " * Number of boolean constants for vertex programs: "
             + StringConverter::toString(mVertexProgramConstantBoolCount));
		pLog->logMessage(
			" * Fragment programs: "
			+ StringConverter::toString(hasCapability(RSC_FRAGMENT_PROGRAM), true));
		pLog->logMessage(
             " * Number of floating-point constants for fragment programs: "
             + StringConverter::toString(mFragmentProgramConstantFloatCount));
		pLog->logMessage(
             " * Number of integer constants for fragment programs: "
             + StringConverter::toString(mFragmentProgramConstantIntCount));
		pLog->logMessage(
             " * Number of boolean constants for fragment programs: "
             + StringConverter::toString(mFragmentProgramConstantBoolCount));
		pLog->logMessage(
			" * Geometry programs: "
			+ StringConverter::toString(hasCapability(RSC_GEOMETRY_PROGRAM), true));
		pLog->logMessage(
             " * Number of floating-point constants for geometry programs: "
             + StringConverter::toString(mGeometryProgramConstantFloatCount));
		pLog->logMessage(
             " * Number of integer constants for geometry programs: "
             + StringConverter::toString(mGeometryProgramConstantIntCount));
		pLog->logMessage(
             " * Number of boolean constants for geometry programs: "
             + StringConverter::toString(mGeometryProgramConstantBoolCount));
		pLog->logMessage(
			" * Tessellation Hull programs: "
			+ StringConverter::toString(hasCapability(RSC_TESSELLATION_HULL_PROGRAM), true));
		pLog->logMessage(
             " * Number of floating-point constants for tessellation hull programs: "
             + StringConverter::toString(mTessellationHullProgramConstantFloatCount));
		pLog->logMessage(
             " * Number of integer constants for tessellation hull programs: "
             + StringConverter::toString(mTessellationHullProgramConstantIntCount));
		pLog->logMessage(
             " * Number of boolean constants for tessellation hull programs: "
             + StringConverter::toString(mTessellationHullProgramConstantBoolCount));
		pLog->logMessage(
			" * Tessellation Domain programs: "
			+ StringConverter::toString(hasCapability(RSC_TESSELLATION_DOMAIN_PROGRAM), true));
		pLog->logMessage(
             " * Number of floating-point constants for tessellation domain programs: "
             + StringConverter::toString(mTessellationDomainProgramConstantFloatCount));
		pLog->logMessage(
             " * Number of integer constants for tessellation domain programs: "
             + StringConverter::toString(mTessellationDomainProgramConstantIntCount));
		pLog->logMessage(
             " * Number of boolean constants for tessellation domain programs: "
             + StringConverter::toString(mTessellationDomainProgramConstantBoolCount));
		pLog->logMessage(
			" * Compute programs: "
			+ StringConverter::toString(hasCapability(RSC_COMPUTE_PROGRAM), true));
		pLog->logMessage(
             " * Number of floating-point constants for compute programs: "
             + StringConverter::toString(mComputeProgramConstantFloatCount));
		pLog->logMessage(
             " * Number of integer constants for compute programs: "
             + StringConverter::toString(mComputeProgramConstantIntCount));
		pLog->logMessage(
             " * Number of boolean constants for compute programs: "
             + StringConverter::toString(mComputeProgramConstantBoolCount));
		String profileList = "";
		for(ShaderProfiles::iterator iter = mSupportedShaderProfiles.begin(), end = mSupportedShaderProfiles.end();
			iter != end; ++iter)
		{
			profileList += " " + *iter;
		}
		pLog->logMessage(" * Supported Shader Profiles:" + profileList);

		pLog->logMessage(
			" * Texture Compression: "
			+ StringConverter::toString(hasCapability(RSC_TEXTURE_COMPRESSION), true));
		if (hasCapability(RSC_TEXTURE_COMPRESSION))
		{
			pLog->logMessage(
				"   - DXT: "
				+ StringConverter::toString(hasCapability(RSC_TEXTURE_COMPRESSION_DXT), true));
			pLog->logMessage(
				"   - VTC: "
				+ StringConverter::toString(hasCapability(RSC_TEXTURE_COMPRESSION_VTC), true));
			pLog->logMessage(
                 "   - PVRTC: "
                 + StringConverter::toString(hasCapability(RSC_TEXTURE_COMPRESSION_PVRTC), true));
			pLog->logMessage(
                 "   - ATC: "
                 + StringConverter::toString(hasCapability(RSC_TEXTURE_COMPRESSION_ATC), true));
			pLog->logMessage(
                 "   - ETC1: "
                 + StringConverter::toString(hasCapability(RSC_TEXTURE_COMPRESSION_ETC1), true));
			pLog->logMessage(
                 "   - ETC2: "
                 + StringConverter::toString(hasCapability(RSC_TEXTURE_COMPRESSION_ETC2), true));
			pLog->logMessage(
                 "   - BC4/BC5: "
                 + StringConverter::toString(hasCapability(RSC_TEXTURE_COMPRESSION_BC4_BC5), true));
			pLog->logMessage(
                 "   - BC6H/BC7: "
                 + StringConverter::toString(hasCapability(RSC_TEXTURE_COMPRESSION_BC6H_BC7), true));
		}

		pLog->logMessage(
			" * Scissor Rectangle: "
			+ StringConverter::toString(hasCapability(RSC_SCISSOR_TEST), true));
		pLog->logMessage(
			" * Hardware Occlusion Query: "
			+ StringConverter::toString(hasCapability(RSC_HWOCCLUSION), true));
		pLog->logMessage(
			" * User clip planes: "
			+ StringConverter::toString(hasCapability(RSC_USER_CLIP_PLANES), true));
		pLog->logMessage(
			" * VET_UBYTE4 vertex element type: "
			+ StringConverter::toString(hasCapability(RSC_VERTEX_FORMAT_UBYTE4), true));
		pLog->logMessage(
			" * Infinite far plane projection: "
			+ StringConverter::toString(hasCapability(RSC_INFINITE_FAR_PLANE), true));
		pLog->logMessage(
			" * Hardware render-to-texture: "
			+ StringConverter::toString(hasCapability(RSC_HWRENDER_TO_TEXTURE), true));
		pLog->logMessage(
			" * Floating point textures: "
			+ StringConverter::toString(hasCapability(RSC_TEXTURE_FLOAT), true));
		pLog->logMessage(
			" * Non-power-of-two textures: "
			+ StringConverter::toString(hasCapability(RSC_NON_POWER_OF_2_TEXTURES), true)
			+ (mNonPOW2TexturesLimited ? " (limited)" : ""));
		pLog->logMessage(
			" * 1d textures: "
			+ StringConverter::toString(hasCapability(RSC_TEXTURE_1D), true));
		pLog->logMessage(
			" * Volume textures: "
			+ StringConverter::toString(hasCapability(RSC_TEXTURE_3D), true));
		pLog->logMessage(
			" * Multiple Render Targets: "
			+ StringConverter::toString(mNumMultiRenderTargets));
		pLog->logMessage(
			"   - With different bit depths: " + StringConverter::toString(hasCapability(RSC_MRT_DIFFERENT_BIT_DEPTHS), true));
		pLog->logMessage(
			" * Point Sprites: "
			+ StringConverter::toString(hasCapability(RSC_POINT_SPRITES), true));
		pLog->logMessage(
			" * Extended point parameters: "
			+ StringConverter::toString(hasCapability(RSC_POINT_EXTENDED_PARAMETERS), true));
		if(hasCapability(RSC_POINT_SPRITES))
		{
			pLog->logMessage(
				" * Max Point Size: "
				+ StringConverter::toString(mMaxPointSize));
		}
		pLog->logMessage(
			" * Vertex texture fetch: "
			+ StringConverter::toString(hasCapability(RSC_VERTEX_TEXTURE_FETCH), true));
		pLog->logMessage(
             " * Number of world matrices: "
             + StringConverter::toString(mNumWorldMatrices));
		pLog->logMessage(
             " * Number of texture units: "
             + StringConverter::toString(mNumTextureUnits));
		pLog->logMessage(
             " * Stencil buffer depth: "
             + StringConverter::toString(mStencilBufferBitDepth));
		pLog->logMessage(
             " * Number of vertex blend matrices: "
             + StringConverter::toString(mNumVertexBlendMatrices));
		if (hasCapability(RSC_VERTEX_TEXTURE_FETCH))
		{
			pLog->logMessage(
				"   - Max vertex textures: "
				+ StringConverter::toString(mNumVertexTextureUnits));
			pLog->logMessage(
				"   - Vertex textures shared: "
				+ StringConverter::toString(mVertexTextureUnitsShared, true));

		}
		pLog->logMessage(
			" * Render to Vertex Buffer : "
			+ StringConverter::toString(hasCapability(RSC_HWRENDER_TO_VERTEX_BUFFER), true));
        pLog->logMessage(
            " * Hardware Atomic Counters: "
            + StringConverter::toString(hasCapability(RSC_ATOMIC_COUNTERS), true));

		if (mCategoryRelevant[CAPS_CATEGORY_GL])
		{
			pLog->logMessage(
				" * GL 1.5 without VBO workaround: "
				+ StringConverter::toString(hasCapability(RSC_GL1_5_NOVBO), true));

			pLog->logMessage(
				" * Frame Buffer objects: "
				+ StringConverter::toString(hasCapability(RSC_FBO), true));
			pLog->logMessage(
				" * Frame Buffer objects (ARB extension): "
				+ StringConverter::toString(hasCapability(RSC_FBO_ARB), true));
			pLog->logMessage(
				" * Frame Buffer objects (ATI extension): "
				+ StringConverter::toString(hasCapability(RSC_FBO_ATI), true));
			pLog->logMessage(
				" * PBuffer support: "
				+ StringConverter::toString(hasCapability(RSC_PBUFFER), true));
			pLog->logMessage(
				" * GL 1.5 without HW-occlusion workaround: "
				+ StringConverter::toString(hasCapability(RSC_GL1_5_NOHWOCCLUSION), true));
            pLog->logMessage(
                " * Vertex Array Objects: "
                + StringConverter::toString(hasCapability(RSC_VAO), true));
			pLog->logMessage(
                " * Separate shader objects: "
                + StringConverter::toString(hasCapability(RSC_SEPARATE_SHADER_OBJECTS), true));
		}

		if (mCategoryRelevant[CAPS_CATEGORY_D3D9])
		{
			pLog->logMessage(
				" * DirectX per stage constants: "
				+ StringConverter::toString(hasCapability(RSC_PERSTAGECONSTANT), true));
		}
#endif
	}
// -----------------------------------------------------------------------------------------
void CPepeEngineRendererCapabilities::log()
{
    LOG("Renderer capabilities");
    LOG("-------------------------");
    LOG("RenderSystem Name: "                   + CPepeEngineCore::getSingleton().getRenderer()->getName());
    //LOG("GPU Vendor: "                            + vendorToString(getVendor()));
    //LOG("Device Name: "                           + getDeviceName());
    //LOG("Driver Version: "                        + getDriverVersion().parseString());
    LOG(" * Hardware generation of mipmaps: "   + CPepeEngineConverter::parseString(hasCapability(RC_AUTOMIPMAP)));
    LOG(" * Texture blending: "                 + CPepeEngineConverter::parseString(hasCapability(RC_BLENDING)));
    LOG(" * Anisotropic texture filtering: "    + CPepeEngineConverter::parseString(hasCapability(RC_ANISOTROPY)));
    LOG(" * Dot product texture operation: "    + CPepeEngineConverter::parseString(hasCapability(RC_DOT3)));
    LOG(" * Cube mapping: "                     + CPepeEngineConverter::parseString(hasCapability(RC_CUBEMAPPING)));
    LOG(" * Hardware stencil buffer: "          + CPepeEngineConverter::parseString(hasCapability(RC_HWSTENCIL)));

    if (hasCapability(RC_HWSTENCIL)) {
        LOG("   - Stencil depth: "              + CPepeEngineConverter::parseString((float)getStencilBufferBitDepth()));
        LOG("   - Two sided stencil support: "  + CPepeEngineConverter::parseString(hasCapability(RC_TWO_SIDED_STENCIL)));
        LOG("   - Wrap stencil values: "        + CPepeEngineConverter::parseString(hasCapability(RC_STENCIL_WRAP)));
    }

    LOG(" * Hardware vertex / index buffers: "  + CPepeEngineConverter::parseString(hasCapability(RC_VBO)));
    LOG(" * Vertex programs: "                  + CPepeEngineConverter::parseString(hasCapability(RC_VERTEX_PROGRAM)));
    LOG("   - Max vertex program version: "     + getMaxVertexProgramVersion());
    LOG(" * Pixel programs: "                   + CPepeEngineConverter::parseString(hasCapability(RC_PIXEL_PROGRAM)));
    LOG("   - Max pixel program version: "      + getMaxPixelProgramVersion());


    LOG(" * Texture Compression: "      + CPepeEngineConverter::parseString(hasCapability(RC_TEXTURE_COMPRESSION)));

    if (hasCapability(RC_TEXTURE_COMPRESSION)) {
        LOG("   - DXT: "    + CPepeEngineConverter::parseString(hasCapability(RC_TEXTURE_COMPRESSION_DXT)));
        LOG("   - VTC: "    + CPepeEngineConverter::parseString(hasCapability(RC_TEXTURE_COMPRESSION_VTC)));
    }

    LOG(" * Scissor Rectangle: "                + CPepeEngineConverter::parseString(hasCapability(RC_SCISSOR_TEST)));
    LOG(" * Hardware Occlusion Query: "         + CPepeEngineConverter::parseString(hasCapability(RC_HWOCCLUSION)));
    LOG(" * User clip planes: "                 + CPepeEngineConverter::parseString(hasCapability(RC_USER_CLIP_PLANES)));
    LOG(" * VET_UBYTE4 vertex element type: "   + CPepeEngineConverter::parseString(hasCapability(RC_VERTEX_FORMAT_UBYTE4)));
    LOG(" * Infinite far plane projection: "    + CPepeEngineConverter::parseString(hasCapability(RC_INFINITE_FAR_PLANE)));
    LOG(" * Hardware render-to-texture: "       + CPepeEngineConverter::parseString(hasCapability(RC_HWRENDER_TO_TEXTURE)));
    LOG(" * Floating point textures: "          + CPepeEngineConverter::parseString(hasCapability(RC_TEXTURE_FLOAT)));
    LOG(" * Non-power-of-two textures: "        + CPepeEngineConverter::parseString(hasCapability(RC_NON_POWER_OF_2_TEXTURES)) + (m_bNonPOW2TexturesLimited ? _T(" (limited)") : _T("")));
    LOG(" * Volume textures: "                  + CPepeEngineConverter::parseString(hasCapability(RC_TEXTURE_3D)));
    LOG(" * Multiple Render Targets: "          + CPepeEngineConverter::parseString((float)m_nNumMultiRenderTargets));
    LOG(" * Point Sprites: "                    + CPepeEngineConverter::parseString(hasCapability(RC_POINT_SPRITES)));
    LOG(" * Extended point parameters: "        + CPepeEngineConverter::parseString(hasCapability(RC_POINT_EXTENDED_PARAMETERS)));
    LOG(" * Max Point Size: "                   + CPepeEngineConverter::parseString(m_fMaxPointSize));
    LOG(" * Vertex texture fetch: "             + CPepeEngineConverter::parseString(hasCapability(RC_VERTEX_TEXTURE_FETCH)));

    if (hasCapability(RC_VERTEX_TEXTURE_FETCH)) {
        LOG("   - Max vertex textures: "        + CPepeEngineConverter::parseString((float)m_nNumVertexTextureUnits));
        LOG("   - Vertex textures shared: "     + CPepeEngineConverter::parseString(m_bVertexTextureUnitsShared));
    }
}