+++ /dev/null
-// jniSceneEditor.cpp : Defines the entry point for the console application.
-//
-
-#include "FUiAnim_DisplayManager.h"
-#include "FUiAnim_AnimationManager.h"
-#include "FUiAnim_RootVisualElement.h"
-#include "FUiAnimVisualElement.h"
-#include "FUiAnimVisualElementSurface.h"
-#include "FUiAnim_NativeLayer.h"
-#include "FGrpFloatRectangle.h"
-#include "FGrpBufferInfo.h"
-#include "FUiAnimDisplayContext.h"
-#include "FUiAnim_DisplayContextImpl.h"
-#include "FUiAnim_NativeWindow.h"
-#include "FUiAnim_Win32Window.h"
-#include "FUiAnim_GlLayer.h"
-
-#include "org_tizen_tools_areditor_sceneeditor_editor3d_NativeSceneEditor.h"
-#include <jni_md.h>
-
-using namespace Tizen::Graphics;
-using namespace Tizen::Ui::Animations;
-
-_NativeLayer* pNativeLayer = null;
-DisplayContext* pContext = null;
-VisualElement* pVisualElement = null;
-
-JNIEXPORT void JNICALL Java_org_tizen_tools_areditor_sceneeditor_editor3d_NativeSceneEditor_init
- (JNIEnv *, jobject, jint handle, jint width, jint height){
-
- #if 0
- //------------------------------
- // Please, insert your code here
- //------------------------------
-
- /*CreateContext ( (HWND)handle, width, height );
- // get the device context (DC)
- gg_hDC = GetDC( (HWND)handle );
- //OnInit
- ResourceManager* resourceManager = ResourceManager::GetInstance();
- __pScene = new Scene("Scene");
-
- __pRenderSystem = new Tizen::Ui::Renderer::RenderSystem();
- __pRenderSystem->Create();
- __pRenderSystem->SetBackgroundColor(1.0f, 0.2f, 0.2f, 0.2f);
- __pRenderSystem->InitViewport(0, 0, width, height, 45.0f, 0.1f, 1000.0f);
- __pRenderSystem->UpdateScreen();
-
- __pRenderSystem->GetCamera()->Perspective(45.0f, (float)width / height, 0.1f, 1000.0f);
- __pRenderSystem->GetCamera()->LookAt(Vector3(0, 0, 100), Vector3(0, 0, 0), Vector3(0, 1, 0));
-
- __pScene->Update();
-
- FileSystem::ShaderPath = "Shaders/";
- FileSystem::MaterialPath = "Materials/";
- FileSystem::TexturePath = "Textures/";
-
-
- std::string ModelFileName1 = "ColladaModels/ColorCube.dae";//"../../../Demos/ColladaModels/ColorCube.dae";
- std::string ModelFileName2 = "ColladaModels/scorpion_.DAE";//"../../../Demos/ColladaModels/scorpion_.DAE";
- std::string ModelFileName3 = "ColladaModels/lizard_animation_1.DAE";
- std::string ModelFileName4 = "ColladaModels/astroBoy_walk_Maya.dae";
-
- __pGrid.SetLines ( 5.0f, 10.0f, 50.0f );
- __pGrid.Create ( __pRenderSystem );
- GizmoManager::Setting(__pScene,__pRenderSystem);
-
- glEnable(GL_DEPTH_TEST);*/
-#endif
- //
- // Please remind that this code is only for testing...
- //
-
- // Initialize
- _AnimationManager::CreateInstance();
- _DisplayManager::CreateInstance();
-
- _Win32Window* pWindow = new _Win32Window(handle);
-
- pNativeLayer = new _GlLayer();
- ((_GlLayer*)pNativeLayer)->ConstructForNativeWindow(*pWindow);
-
- pNativeLayer->SetShowState(true);
- pContext = _DisplayContextImpl::CreatePublicInstance(*pNativeLayer);
-
- // Create a Visual Element
- _RootVisualElement* pRoot = pNativeLayer->GetRootVisualElement();
- if (pRoot)
- {
- pVisualElement = new VisualElement();
- pVisualElement->Construct();
- pVisualElement->SetShowState(true);
- pVisualElement->SetBounds(FloatRectangle(0, 0, 100, 100));
- pRoot->AttachChild(pVisualElement);
-
- VisualElementSurface* pSurface = new VisualElementSurface();
- pSurface->Construct(*pContext, FloatDimension(100, 100));
-
- BufferInfo bufferInfo;
- pSurface->GetBufferInfo(bufferInfo);
-
- // Set Pixels
- memset(bufferInfo.pPixels, 0xFF, bufferInfo.width * bufferInfo.height * 4);
-
- pVisualElement->SetSurface(pSurface);
- //pElement->Flush();
- }
-}
-
-JNIEXPORT void JNICALL Java_org_tizen_tools_areditor_sceneeditor_editor3d_NativeSceneEditor_resize
- (JNIEnv *, jobject, jint width, jint height){
-
- //------------------------------
- // Please, insert your code here
- //------------------------------
-
- /*__pRenderSystem->InitViewport ( 0, 0, width, height);
- __pRenderSystem->GetCamera()->Perspective(45.0f, (float)width / height, 0.1f, 1000.0f);*/
-}
-
-JNIEXPORT void JNICALL Java_org_tizen_tools_areditor_sceneeditor_editor3d_NativeSceneEditor_repaint
- (JNIEnv *, jobject, jfloat dt){
-
- //------------------------------
- // Please, insert your code here
- //------------------------------
-
- //////////////////////////////Update////////////////////////////////////////////////////
- /*float fElapsedTime = dt;
- __pRenderSystem->SetProjectionMatrix(__pRenderSystem->GetCamera()->GetProjection());
- __pScene->Update();
-
- Matrix4 mat;
- mat.Identity();
- __pGrid.WorldMatrix = mat;
- __pGrid.Update( fElapsedTime );
-
- GizmoManager::Update(0,0);
-
- ///////////////////// Draw //////////////////////////////////////////////////////////////////////
- __pRenderSystem->Clear(ClearFlag::COLOR | ClearFlag::ZBUFFER | ClearFlag::STENCIL);
-
- __pScene->FindVisible(__pRenderSystem, __pScene->GetRootNodeScene());
-
- __pRenderSystem->BeginRender();
- __pRenderSystem->RenderStages();
- __pRenderSystem->EndRender();
-
- SwapBuffers(gg_hDC);
- */
- pVisualElement->Flush();
- pNativeLayer->Flush();
-}
-