本文整理汇总了C++中setupGraphics函数的典型用法代码示例。如果您正苦于以下问题:C++ setupGraphics函数的具体用法?C++ setupGraphics怎么用?C++ setupGraphics使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了setupGraphics函数的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的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;
}
}
开发者ID:ikryukov,项目名称:ShadowsAndroid,代码行数:25,代码来源:Shadows.cpp
示例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);
}
开发者ID:ntkachov,项目名称:ElectraEngine,代码行数:7,代码来源:gl_code.cpp
示例3: setupIO
void HodginDidItApp::setup()
{
setupIO();
setupCiCamera();
setupGraphics();
setupShaders();
setupFbos();
}
开发者ID:SethGibson,项目名称:HodginDidIt,代码行数:8,代码来源:HodginDidItApp.cpp
示例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);
}
}
开发者ID:mtschoen,项目名称:opengl-android,代码行数:9,代码来源:natRenderer_jni.cpp
示例5: QMainWindow
MainWindow::MainWindow(QWidget *parent) :
QMainWindow(parent),
ui(new Ui::MainWindow)
{
ui->setupUi(this);
setupGraphics();
this->setFocus();
}
开发者ID:redukt0r,项目名称:MysticQuest,代码行数:9,代码来源:mainwindow.cpp
示例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);
}
开发者ID:a-s-j,项目名称:spinningcube,代码行数:10,代码来源:gl_code.cpp
示例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();
}
开发者ID:gamepattisiere,项目名称:laboratory,代码行数:55,代码来源:sample.cpp
示例8: setupOsc
//--------------------------------------------------------------
void testApp::setup(){
setupOsc();
setupKinect();
setupGraphics();
mode = Donk::Mode::getInstance();
// default starting mode
nextMode = "buzz";
mode->setMode(nextMode);
}
开发者ID:imclab,项目名称:24HourMusic,代码行数:12,代码来源:testApp.cpp
示例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();
}
开发者ID:venkatarajasekhar,项目名称:viper,代码行数:54,代码来源:KdTreeVsBroadphaseDemo.cpp
示例10: QMainWindow
ZChessCraft::ZChessCraft(QWidget *parent) :
QMainWindow(parent),
ui(new Ui::ZChessCraft)
{
ui->setupUi(this);
setupChessModel();
setupGraphics();
setupChessboard();
setupChessmen();
setupComputer();
}
开发者ID:eoodin,项目名称:zchesscraft,代码行数:12,代码来源:zchesscraft.cpp
示例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);
}
开发者ID:HellicarAndLewis,项目名称:StreamMirrors,代码行数:53,代码来源:testApp.cpp
示例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);
}
开发者ID:olegzil,项目名称:NativeCrawler,代码行数:39,代码来源:main.c
示例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();
});
}
开发者ID:VolkerChristian,项目名称:kile,代码行数:51,代码来源:configurationdialog.cpp
示例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();
}
开发者ID:venkatarajasekhar,项目名称:viper,代码行数:51,代码来源:WindChimesDemo.cpp
示例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");
}
开发者ID:DanilinEgor,项目名称:asteroids,代码行数:14,代码来源:ship.cpp
示例16: Java_jk_j_1JNILib_init
JNIEXPORT void JNICALL Java_jk_j_1JNILib_init(JNIEnv * env, jobject obj, jobject activity, jint width, jint height)
{
jclass android_content_Context =env->GetObjectClass(activity);
jmethodID midGetPackageName = env->GetMethodID(android_content_Context, "getPackageName", "()Ljava/lang/String;");
jstring packageName= (jstring)env->CallObjectMethod(activity, midGetPackageName);
const char *aa = env->GetStringUTFChars(packageName, NULL);
if (strcmp(aa, APP_PACKAGE_NAME) != 0)
{
hasPermission = false;
}
setupGraphics(width, height);
}
开发者ID:khanhbui,项目名称:jEngine,代码行数:15,代码来源:GameWrapper.cpp
示例17: in
hkDemo::Result WorldSnapshotWithContactPointsDemo::stepDemo()
{
Result r = hkDefaultPhysicsDemo::stepDemo();
if( r != DEMO_OK )
{
return r;
}
// The first button in the pad will load the last saved scene
if( m_env->m_gamePad->wasButtonPressed( HKG_PAD_BUTTON_1 ) )
{
hkString filename = hkAssetManagementUtil::getFilePath( SCRATCH_FILE );
hkIstream in(filename.cString());
if( in.isOk() )
{
cleanupWorld();
cleanupGraphics();
hkpWorld::IgnoreForceMultithreadedSimulation ignoreForceMultithreaded;
m_world = loadWorld(filename.cString(), &m_physicsData, &m_loadedData);
m_debugViewerNames.pushBack( hkpActiveContactPointViewer::getName() );
m_debugViewerNames.pushBack( hkpInactiveContactPointViewer::getName() );
setupGraphics();
}
else
{
m_env->m_textDisplay->outputText("Please save before attempting to load", 20U, m_env->m_window->getHeight()/2, 0xffffffffU, 60);
}
}
else if (m_env->m_gamePad->wasButtonPressed (HKG_PAD_BUTTON_2) )
{
// The second button in the pad will save the current scene
saveWorld(m_world, SCRATCH_FILE, true);
}
else if (m_env->m_gamePad->wasButtonPressed (HKG_PAD_BUTTON_3) )
{
// The second button in the pad will save the current scene
saveWorld(m_world, SCRATCH_FILE, false);
}
m_world->lock();
m_world->updateCollisionFilterOnWorld( HK_UPDATE_FILTER_ON_WORLD_FULL_CHECK, HK_UPDATE_COLLECTION_FILTER_PROCESS_SHAPE_COLLECTIONS);
m_world->unlock();
return DEMO_OK;
}
开发者ID:zhou-yi,项目名称:viper,代码行数:48,代码来源:WorldSnapshotWithContactPointsDemo.cpp
示例18: main
int main(int argc, char *argv[])
{
ESContext esContext;
UserData userData;
esInitContext(&esContext);
esContext.userData = &userData;
esCreateWindow(&esContext, TEXT("Hello Triangle"), 800, 600, ES_WINDOW_RGB);
setupGraphics(800, 600);
esRegisterDrawFunc(&esContext, Draw);
esMainLoop(&esContext);
}
开发者ID:fomonster,项目名称:crossplatform-cpp,代码行数:17,代码来源:main.cpp
示例19: CTest
CTest(): spApp(core::IApplication::Create())
{
spApp->addTask(core::PTask(new core::CRenderTask(2)));
spApp->addTask(core::PTask(new core::CGameTask(1)));
spApp->addTask(core::PTask(new core::CInputTask(0)));
//инициализация рендера
setupGraphics();
//инициализация ввода
setupInput();
//инициализация камер
setupCameras();
spApp->Run();
}
开发者ID:strelkovsky,项目名称:rgdengine,代码行数:18,代码来源:main.cpp
示例20: AbstractRobot
RobotProjet::RobotProjet(RS232& serialPort):
AbstractRobot(serialPort),
_corp(8),
_roueGauche(sf::Vector2f(26,100)),
_roueDroite(sf::Vector2f(26,100)),
_widget(0)
{
_corp.setPoint(0, sf::Vector2f(45, 0));
_corp.setPoint(1, sf::Vector2f(330-45, 0));
_corp.setPoint(2, sf::Vector2f(330, 45));
_corp.setPoint(3, sf::Vector2f(330, 330-45));
_corp.setPoint(4, sf::Vector2f(330-45, 330));
_corp.setPoint(5, sf::Vector2f(45, 330));
_corp.setPoint(6, sf::Vector2f(0, 330-45));
_corp.setPoint(7, sf::Vector2f(0, 45));
_color= sf::Color(157,172,230,255);
_texture.loadFromFile("projet_robot.png");
_corp.setTexture(&_texture,true);
setupGraphics();
}
开发者ID:BDENE666,项目名称:arenib_interface,代码行数:20,代码来源:projet_robot.cpp
注:本文中的setupGraphics函数示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论