3 // Copyright (c) 2012 Samsung Electronics Co., Ltd.
5 // Licensed under the Flora License, Version 1.0 (the License);
6 // you may not use this file except in compliance with the License.
7 // You may obtain a copy of the License at
9 // http://www.tizenopensource.org/license
11 // Unless required by applicable law or agreed to in writing, software
12 // distributed under the License is distributed on an AS IS BASIS,
13 // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14 // See the License for the specific language governing permissions and
15 // limitations under the License.
25 #include <FGraphics.h>
28 #include <FGraphicsOpengl2.h>
33 Osp::Graphics::Opengl::GLfloat m[4][4];
37 public Osp::App::Application,
38 public Osp::System::IScreenEventListener,
39 public Osp::Ui::IKeyEventListener,
40 public Osp::Base::Runtime::ITimerEventListener
43 static Osp::App::Application* CreateInstance(void);
48 virtual bool OnAppInitializing(Osp::App::AppRegistry& appRegistry);
49 virtual bool OnAppTerminating(Osp::App::AppRegistry& appRegistry, bool forcedTermination = false);
50 virtual void OnForeground(void);
51 virtual void OnBackground(void);
52 virtual void OnLowMemory(void);
53 virtual void OnBatteryLevelChanged(Osp::System::BatteryLevel batteryLevel);
54 virtual void OnKeyPressed(const Osp::Ui::Control& source, Osp::Ui::KeyCode keyCode);
55 virtual void OnKeyReleased(const Osp::Ui::Control& source, Osp::Ui::KeyCode keyCode);
56 virtual void OnKeyLongPressed(const Osp::Ui::Control& source, Osp::Ui::KeyCode keyCode);
58 virtual void OnScreenOn(void);
59 virtual void OnScreenOff(void);
61 virtual void OnTimerExpired(Osp::Base::Runtime::Timer& timer);
71 void LoadIdentity(Matrix* pResult);
72 void Frustum(Matrix* pResult, float left, float right, float bottom, float top, float nearZ, float farZ);
73 void Perspective(Matrix* pResult, float fovY, float aspect, float nearZ, float farZ);
74 void Translate(Matrix* pResult, Osp::Graphics::Opengl::GLfloat tx, Osp::Graphics::Opengl::GLfloat ty,
75 Osp::Graphics::Opengl::GLfloat tz);
76 void Rotate(Matrix* pResult, Osp::Graphics::Opengl::GLfloat angle, Osp::Graphics::Opengl::GLfloat x,
77 Osp::Graphics::Opengl::GLfloat y, Osp::Graphics::Opengl::GLfloat z);
78 void Multiply(Matrix* pResult, Matrix* pSrcA, Matrix* pSrcB);
81 Osp::Graphics::Opengl::EGLDisplay __eglDisplay;
82 Osp::Graphics::Opengl::EGLSurface __eglSurface;
83 Osp::Graphics::Opengl::EGLConfig __eglConfig;
84 Osp::Graphics::Opengl::EGLContext __eglContext;
85 Osp::Graphics::Opengl::GLuint __programObject;
86 Osp::Graphics::Opengl::GLint __idxPosition;
87 Osp::Graphics::Opengl::GLint __idxColor;
88 Osp::Graphics::Opengl::GLint __idxMVP;
89 Osp::Graphics::Opengl::GLfloat __angle;
90 Osp::Base::Runtime::Timer* __pTimer;
93 Osp::Ui::Controls::Form* __pForm;
96 #endif // __GLES_CUBE_H__