本文整理汇总了C++中setupGraphics函数的典型用法代码示例。如果您正苦于以下问题:C++ setupGraphics函数的具体用法?C++ setupGraphics怎么用?C++ setupGraphics使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了setupGraphics函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: engine_handle_cmd
static void engine_handle_cmd(struct android_app* app, int32_t cmd) {
switch (cmd) {
case APP_CMD_SAVE_STATE:
// The system has asked us to save our current state. Do so.
break;
case APP_CMD_INIT_WINDOW:
// The window is being shown, get it ready.
if (app->window != NULL) {
setupGraphics(app);
// renderFrame();
}
break;
case APP_CMD_TERM_WINDOW:
// The window is being hidden or closed, clean it up.
break;
case APP_CMD_GAINED_FOCUS:
// When our app gains focus, we start monitoring the accelerometer.
break;
case APP_CMD_LOST_FOCUS:
// When our app loses focus, we stop monitoring the accelerometer.
// This is to avoid consuming battery while not being used.
// Also stop animating.
break;
}
}
示例2: Java_com_fbrs_electraengine_GL2JNILib_init
JNIEXPORT void JNICALL Java_com_fbrs_electraengine_GL2JNILib_init(JNIEnv * env, jobject obj, jint width, jint height, jstring vertexShader, jstring fragShader)
{
jboolean *isCopy;
gVertexShader = env->GetStringUTFChars(vertexShader, isCopy);
gFragmentShader = env->GetStringUTFChars(fragShader, isCopy);
setupGraphics(width, height);
}
示例3: setupIO
void HodginDidItApp::setup()
{
setupIO();
setupCiCamera();
setupGraphics();
setupShaders();
setupFbos();
}
示例4: Java_ondrej_platek_bind_NativeRenderer_initG
JNIEXPORT void JNICALL Java_ondrej_platek_bind_NativeRenderer_initG(JNIEnv * env, jobject mythis) {
AppCtx * c = reinterpret_cast<AppCtx*>(extractInt(env, mythis, "pAppCtx"));
if(c == NULL) {
LOGE("NativeRender_init context is NULL");
}
else {
setupGraphics(c);
}
}
示例5: QMainWindow
MainWindow::MainWindow(QWidget *parent) :
QMainWindow(parent),
ui(new Ui::MainWindow)
{
ui->setupUi(this);
setupGraphics();
this->setFocus();
}
示例6: Java_com_android_spinningcube_SpinningCubeLib_init
JNIEXPORT void JNICALL Java_com_android_spinningcube_SpinningCubeLib_init(JNIEnv * env, jobject obj, jint width, jint height, jstring vShader, jstring fShader)
{
if(!gVertexShader && !gFragmentShader) {
gVertexShader = env->GetStringUTFChars(vShader, 0);
gFragmentShader = env->GetStringUTFChars(fShader, 0);
}
setupGraphics(width, height);
stats_init(&stats);
}
示例7: hkDefaultPhysicsDemo
AddRemoveBodiesDemo::AddRemoveBodiesDemo(hkDemoEnvironment* env)
: hkDefaultPhysicsDemo(env),
m_frameCount(0),
m_currentBody(0)
{
for( int i = 0; i < NUM_BODIES; i++ )
{
m_bodies[i] = HK_NULL;
}
//
// Setup the camera
//
{
hkVector4 from(0.0f, 30.0f, 50.0f);
hkVector4 to (0.0f, 0.0f, 0.0f);
hkVector4 up (0.0f, 1.0f, 0.0f);
setupDefaultCameras(env, from, to, up);
float lightDir[] = { -1, -0.5f , -0.25f};
float lightAabbMin[] = { -15, -15, -15};
float lightAabbMax[] = { 15, 15, 15};
setLightAndFixedShadow(lightDir, lightAabbMin, lightAabbMax );
}
//
// Setup and create the hkpWorld
//
{
hkpWorldCinfo info;
info.m_gravity = hkVector4(0.0f, -9.8f, 0.0f);
info.setBroadPhaseWorldSize(1000.0f);
info.setupSolverInfo(hkpWorldCinfo::SOLVER_TYPE_8ITERS_MEDIUM);
info.m_collisionTolerance = 0.01f;
m_world = new hkpWorld( info );
m_world->lock();
setupGraphics();
}
// Register the single agent required (a hkpBoxBoxAgent)
{
hkpAgentRegisterUtil::registerAllAgents(m_world->getCollisionDispatcher());
}
// Create the rigid bodies
createBodies();
// Create the ground
createGround();
m_world->unlock();
}
示例8: setupOsc
//--------------------------------------------------------------
void testApp::setup(){
setupOsc();
setupKinect();
setupGraphics();
mode = Donk::Mode::getInstance();
// default starting mode
nextMode = "buzz";
mode->setMode(nextMode);
}
示例9: hkDefaultPhysicsDemo
KdTreeVsBroadphaseDemo::KdTreeVsBroadphaseDemo(hkDemoEnvironment* env)
: hkDefaultPhysicsDemo(env),
m_flattenRays(false),
m_rand(1337)
{
{
m_worldSizeX = 2.0f * hkMath::sqrt(hkReal(m_env->m_cpuMhz));
m_worldSizeY = 3;
m_worldSizeZ = m_worldSizeX;
}
// Setup the camera and graphics
{
// setup the camera
hkVector4 from(0.0f, m_worldSizeZ*2.f, -m_worldSizeZ);
hkVector4 to (0.0f, 0.0f, 0.0f);
hkVector4 up (0.0f, 1.0f, 0.0f);
setupDefaultCameras( env, from, to, up, 1.0f, 5000.0f );
}
{
hkpWorldCinfo cinfo;
cinfo.m_gravity.setAll(0);
cinfo.m_broadPhaseWorldAabb.m_max.set( m_worldSizeX, 10.0f*m_worldSizeY, m_worldSizeZ);
cinfo.m_broadPhaseWorldAabb.m_min.setNeg4( cinfo.m_broadPhaseWorldAabb.m_max );
cinfo.m_useKdTree = true;
m_world = new hkpWorld(cinfo);
m_world->lock();
}
{
hkpAgentRegisterUtil::registerAllAgents(m_world->getCollisionDispatcher());
}
//
// Add a lot of rigid bodies to the world
//
{
hkAabb worldAabb;
worldAabb.m_max.set( m_worldSizeX, 10.0f*m_worldSizeY, m_worldSizeZ);
worldAabb.m_min.setNeg4( worldAabb.m_max );
hkpMotion::MotionType motionType = hkpMotion::MOTION_FIXED;
KdTreeDemoUtils::createRandomBodies(m_world, worldAabb, numBodies, motionType, &m_rand, m_collidables);
}
setupGraphics();
m_world->unlock();
}
示例10: QMainWindow
ZChessCraft::ZChessCraft(QWidget *parent) :
QMainWindow(parent),
ui(new Ui::ZChessCraft)
{
ui->setupUi(this);
setupChessModel();
setupGraphics();
setupChessboard();
setupChessmen();
setupComputer();
}
示例11: setupGraphics
//--------------------------------------------------------------
void testApp::setup(){
HOLD_COUNT = 200;
setupGraphics();
setupVision();
presenceDetector.setup();
thanksSign.setup();
lastTimeFinishedRecording = -1000;
video = new RamVideo();
video->setup(480, 640, MAX_VIDEO_LENGTH);
triggerDepth = 100;
drawDebug = false;
minRecordingInterval = 4;
carousel.setVideoFeed(&videoFeed);
gui.addToggle("Draw Debug", drawDebug);
gui.addSlider("Count down time", HOLD_COUNT, 80, 350);
gui.addSlider("Min Time between recordings", minRecordingInterval, 2, 20);
gui.addSlider("Carousel video duration", carousel.frameDuration, 10, 200);
gui.addSlider("Carousel inactivity delay", carouselDelay, 0, 5);
gui.addSlider("Slide time pct", carousel.slideTime, 0.05, 1);
gui.addTitle("Carousel");
gui.addSlider("Overlap", carousel.overlap, 0, 260);
gui.addTitle("Triggers");
gui.addSlider("Triggers Horizontal", presenceDetector.triggersX, 0, VISION_HEIGHT);
gui.addSlider("Triggers Vertical", presenceDetector.triggersY, 0, VISION_WIDTH);
gui.addSlider("Triggers Radius", presenceDetector.triggerRadius, 0, 100);
gui.addSlider("Trigger Depth", farThreshold, 0, 255);
gui.addToggle("save all videos", saveAllVideos);
gui.addToggle("clear all videos", clearAllVideos);
dots.setup(480, 640);
gui.setAlignRight(true);
gui.setAutoSave(true);
gui.loadFromXML();
recording = false;
clearAllVideos = false;
saveAllVideos = false;
//ofSetOrientation(OF_ORIENTATION_90_LEFT);
}
示例12: engine_init_shaders
static int engine_init_shaders(struct engine* engine) {
LOGI("from engine_init_shaders \n");
setupGraphics(engine->width, engine->height);
AAssetDir* assetDir = AAssetManager_openDir(engine->assetManager, "");
AAssetDir_rewind(assetDir);
const char* name=NULL;
const char* vert=NULL, *frag=NULL;
while ( (name = AAssetDir_getNextFileName(assetDir)) != NULL)
{
if (frag == NULL && NULL != strstr(name, gTagFrag)) //if we haven't found the fragment shader and 'name' is the fragment shader, save it.
frag = name;
if (vert == NULL && NULL != strstr(name, gTagVert)) //if we haven't found the vertex shader and the 'name' is the vertex shader, save it.
vert = name;
if (!vert && !frag) //if we found both files, we're done
break;
}
//open the shader assets
AAsset* fragAsset = AAssetManager_open(engine->assetManager, frag, AASSET_MODE_BUFFER);
if (!fragAsset)
{
LOGE(" error opening %s\n", fragAsset);
return;
}
AAsset* vertAsset = AAssetManager_open(engine->assetManager, vert, AASSET_MODE_BUFFER);
if (!vertAsset)
{
LOGE(" error opening %s\n", vertAsset);
return;
}
//access the shader asset buffer in preperation for reading
const char* fragBuff = (const char*)AAsset_getBuffer(fragAsset);
const char* vertBuff = (const char*)AAsset_getBuffer(vertAsset);
setupGraphics(engine->width, engine->height); //minimaly initialize client graphics state
LoadShaders(fragBuff, AAsset_getLength(fragAsset), vertBuff, AAsset_getLength(vertAsset)); //load the shaders
AAssetDir_close(assetDir);
}
示例13: KPageDialog
Config::Config(KConfig *config, KileInfo *ki, QWidget* parent)
: KPageDialog(parent),
m_config(config),
m_ki(ki)
{
setWindowTitle(i18n("Configure"));
setModal(true);
setObjectName("kileconfiguration");
setFaceType(Tree);
m_config->sync();
// we need a dialog manager
m_manager = new KConfigDialogManager(this,KileConfig::self());
KPageWidgetItem* kilePageWidgetItem = addConfigFolder(i18n("Kile"), "kile");
KPageWidgetItem* latexPageWidgetItem = addConfigFolder(i18n("LaTeX"), "latex-config");
KPageWidgetItem* toolsPageWidgetItem = addConfigFolder(i18n("Tools"), "system-run");
KPageWidgetItem* editorPageWidgetItem = addConfigFolder(i18n("Editor"), "accessories-text-editor");
// setup all configuration pages
setupGeneralOptions(kilePageWidgetItem);
setupAppearance(kilePageWidgetItem);
setupCodeCompletion(kilePageWidgetItem); // complete configuration (dani)
setupHelp(kilePageWidgetItem);
setupScripting(kilePageWidgetItem);
setupUsermenu(kilePageWidgetItem);
setupLivePreview(kilePageWidgetItem);
setupLatex(latexPageWidgetItem);
setupEnvironment(latexPageWidgetItem);
setupGraphics(latexPageWidgetItem);
setupStructure(latexPageWidgetItem);
setupSymbolView(latexPageWidgetItem);
setupTools(toolsPageWidgetItem);
setupQuickPreview(toolsPageWidgetItem); // QuickPreview (dani)
setupEditor(editorPageWidgetItem);
m_configDialogSize = m_config->group("KileConfigDialog");
KWindowConfig::restoreWindowSize(windowHandle(), m_configDialogSize);
// setup connections
//connect(m_manager, SIGNAL(widgetModified()), this, SLOT(slotWidgetModified()));
connect(this, &KPageDialog::accepted, this, &Config::slotAcceptChanges);
connect(this, &KPageDialog::accepted, m_manager, &KConfigDialogManager::updateSettings);
connect(this, &KPageDialog::rejected, this, [=] () {
m_config->markAsClean();
});
}
示例14: hkDefaultPhysicsDemo
WindChimesDemo::WindChimesDemo(hkDemoEnvironment* env)
: hkDefaultPhysicsDemo(env),
m_loader(HK_NULL)
{
const WindChimesVariant& variant = g_variants[m_variantId];
//
// Create the sound manager.
//
//
// Set up the camera
//
{
hkVector4 from(6.0f, 0.0f, 3.0f);
hkVector4 to (0.0f, 0.0f, 0.0f);
hkVector4 up (0.0f, 0.0f, 1.0f);
setupDefaultCameras( env, from, to, up );
}
hkString assetFile = hkAssetManagementUtil::getFilePath(variant.m_assetName);
m_loader = new hkLoader();
hkRootLevelContainer* container = m_loader->load( assetFile.cString() );
HK_ASSERT2(0xaefe9356, container != HK_NULL , "Could not load asset");
hkpPhysicsData* physics = static_cast<hkpPhysicsData*>( container->findObjectByType( hkpPhysicsDataClass.getName() ) );
HK_ASSERT2(0x245982ae, physics != HK_NULL, "Could not find physics data in root level object" );
{
m_world = new hkpWorld( *physics->getWorldCinfo() );
m_world->lock();
hkpAgentRegisterUtil::registerAllAgents(m_world->getCollisionDispatcher());
setupGraphics();
}
m_world->addPhysicsSystem( physics->getPhysicsSystems()[0] );
// There are 5 pipes in the circular chimes asset, called Chime0, Chime1...etc.
for( int i = 0; i < variant.m_numChimes; i++ )
{
hkString chimeName;
chimeName.printf( "Chime%d", i );
hkpRigidBody* chime = physics->findRigidBodyByName( chimeName.cString() );
HK_ASSERT(0x99862353, chime);
new WindChimesCollisionListener( chime, i % variant.m_numDifferentChimeSizes );
}
m_world->unlock();
}
示例15: main
void Ship::init() {
const char gVertexShader[] =
"attribute vec4 vPosition;\n"
"void main() {\n"
" gl_Position = vPosition;\n"
"}\n";
const char gFragmentShader[] =
"precision mediump float;\n"
"void main() {\n"
" gl_FragColor = vec4(0.0, 1.0, 0.0, 1.0);\n"
"}\n";
if (!setupGraphics(gVertexShader, gFragmentShader, gProgram, gvPositionHandle))
LOGE("Ship init error");
}