#ifndef DALI_VR_ENGINE_H
#define DALI_VR_ENGINE_H
+//todor licence
#include <dali/public-api/math/quaternion.h>
#include <stdint.h>
namespace Integration
{
-// using struct so in case of a need to pass more args only structure
-// has to be modified.
+// The Vr engine initialization parameters use a struct so in case of more args added, only this structure needs to be modified.
namespace Vr
{
-struct VrEngineInitParams
+struct VrEngineInitializeParams
{
- // screen settings
+ // Screen settings
int screenWidth;
int screenHeight;
- // eye settings
- uint32_t* fbos; // 2 values
+ // Eye settings
+ uint32_t* frameBufferObjects; ///< 2 values
uint32_t* colorTextures;
- uint32_t* depthTextures; // may be null
+ uint32_t* depthTextures; ///< May be null
};
struct VrEngineEyePose
struct VrEngineRenderTargetInfo
{
int fbos[2];
- int colorTextures[2]; // if -1, then engine will create those buffers
+ int colorTextures[2]; ///< if -1, then engine will create these buffers
int depthTextures[2];
};
} // Anonymous namespace
{
public:
+ //todor rename below enums
enum EYE_ENUM
{
LEFT = 0,
VrEngine()
{
}
- virtual ~VrEngine() {}
- virtual bool Initialize( Vr::VrEngineInitParams* initParams ) = 0;
+ virtual ~VrEngine()
+ {
+ }
+
+ virtual bool Initialize( Vr::VrEngineInitializeParams* initializeParams ) = 0;
+ virtual void SetEnabled( bool enabled ) = 0;
virtual void Start() = 0;
virtual void Stop() = 0;
virtual void PreRender() = 0;
virtual void PostRender() = 0;
virtual void SubmitFrame() = 0;
- // client must perform output validation if necessary
+ // Client must perform output validation if necessary
virtual bool Get( const int property, void* output, int count ) = 0;
virtual bool Set( const int property, const void* input, int count ) = 0;
- // helper functions
+ // Helper functions
bool Get( int property, void* output )
{
return Get( property, output, 1 );
inline bool Get( const int* properties, void** outputs, int count )
{
- // fill output array
+ // Fill output array
for( int i = 0; i < count; ++i )
{
Get( properties[i], outputs[i], 1 );
inline bool Set( const int* properties, const void** inputs, int count )
{
- // fill output array
+ // Fill output array
for( int i = 0; i < count; ++i )
{
return Set( properties[i], inputs[i], 1 );
// EXTERNAL INCLUDES
#include <stdio.h>
#include <stdlib.h>
+//todor
+#include <iostream>
namespace Dali
{
namespace
{
+//todor delete this
#define GL(x) { x; int err = context.GetError(); if(err) { DALI_LOG_ERROR( "GL_ERROR: [%d] '%s', %x\n", __LINE__, #x, (unsigned)err);fflush(stderr);fflush(stdout);} else { /*DALI_LOG_ERROR("GL Call: %s\n", #x); fflush(stdout);*/} }
// These dimensions must match those used by the Tizen VR engine.
VrManager::VrManager( Dali::Integration::VrEngine* vrEngine )
: mVrEngine( vrEngine ),
mHeadNode( NULL ),
- mEnabled( true ),
+ //mEnabled( true ), //todor default to false
+ mEnabled( false ), //todor default to false
mEngineInitialized( false )
{
}
void VrManager::SetEnabled( bool enabled )
{
+ std::cout << "todor: --------------------- VrManager::SetEnabled" << std::endl;
mEnabled = enabled;
+ mVrEngine->SetEnabled( enabled );
}
bool VrManager::IsEnabled() const
if( !mEngineInitialized )
{
// Initialise VR engine.
- Dali::Integration::Vr::VrEngineInitParams params;
- memset( ¶ms, 0, sizeof( Dali::Integration::Vr::VrEngineInitParams ) );
+ Dali::Integration::Vr::VrEngineInitializeParams params;
+ memset( ¶ms, 0, sizeof( Dali::Integration::Vr::VrEngineInitializeParams ) );
params.screenWidth = surfaceWidth;
params.screenHeight = surfaceHeight;
context.GetError();
// This reads all the required VR information in one go.
- int leftFrameBufferObject(-1);
- int rightFrameBufferObject(-1);
- int leftTexture(-1);
- int rightTexture(-1);
- int bufferWidth(-1);
- int bufferHeight(-1);
+ int leftFrameBufferObject( -1 );
+ int rightFrameBufferObject( -1 );
+ int leftTexture( -1 );
+ int rightTexture( -1 );
+ int bufferWidth( -1 );
+ int bufferHeight( -1 );
static const int properties[] =
{