2
我正在阅读OpenGL ES 2.0 Programming Guide,并在他们的示例中使用了他们创建的称为esUtil.h (which has a version for BlackBerry)的帮助程序库,它包含在book examples repository中,问题是现在我想要handle touch events ,但我不知道如何使我的代码与bbutil.h
初始化兼容,因此我可以利用触摸并同时拥有esUtil.h
,因此我可以利用esRegisterDrawFunc
,esRegisterUpdateFunc
和esMainLoop
等功能,不知道如何处理bbutil
。这里是我的代码:使用BlackBerry Native SDK处理触摸事件
#include <stdlib.h>
#include <stdio.h>
#include "esUtil/esUtil.h"
// BlackBerry stuff.
#include "bbutil.h"
#include <bps/bps.h>
#include <bps/screen.h>
// Helpers.
#include "helpers/global.h"
#include "helpers/shaders.h"
// Scene.
#include "scene/scene.h"
int main(int argc, char *argv[]) {
ESContext esContext;
UserData userData;
esInitContext(&esContext);
esContext.userData = &userData;
if (!esCreateWindow(&esContext, TITLE, WINDOW_WIDTH, WINDOW_HEIGHT, ES_WINDOW_RGB))
return 0;
if (!init(&esContext))
return 0;
esRegisterDrawFunc(&esContext, drawScene);
esRegisterUpdateFunc(&esContext, update);
esMainLoop(&esContext);
return 0;
}
有什么建议吗?