Languages

Menu
Sites
Language
How to add touch event in Frame based OGL app?

I find there is a frame-based opengl template and a form-based opengl template on Tizen SDK 2.1.

 

the introduce of form-based ogl template mentions that:
"If you want to make an application which does not use UI controls except Frame, such as games this template is the best choice. "
my app is a game , so I used the frame-based version.
I defined a class inherit of Tizen::Ui::Control and Tizen::Ui::ITouchEventListener called AAA

 

in the function "virtual result OnInitializing(void)" of Frame
AddControl a instance class AAA 

 

in the function "virtual result OnInitializing(void)" of AAA
AddTouchEventListener(*this);

but it does not worked at all .
BTW if i use form based version , it works well.(AAA is inherit of Tizen::Ui::Controls::Form).

so plz tell me how to add control of a Frame-based OGL app, and how to call SetOrientation without a form.

 

 

Edited by: Brock Boland on 17 Mar, 2014 Reason: Paragraph tags added automatically from tizen_format_fix module.

Responses

1 Replies
wil smith
Looks to be an implementation issue at your side. All UI controls, registered as touch event listeners, can handle the touch events. In other words all UI controls can be made to touch event handlers. e.g., class AAA: public Tizen::Ui::Controls::Frame, public Tizen::Ui::ITouchEventListener { // Implement the ITouchEventListener's interfaces }; //Register the frame control as touch event handler result AAA::OnInitializing(void) { AddTouchEventListener(*this); } //Add the frame to your application(say xxx is the application class) bool xxx::OnAppInitializing(AppRegistry &appRegistry ) { AAA *pFrame = new AAA; pFrame->Construct(); AddFrame(*pFrame); }