• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

C++ InitWindow函数代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了C++中InitWindow函数的典型用法代码示例。如果您正苦于以下问题:C++ InitWindow函数的具体用法?C++ InitWindow怎么用?C++ InitWindow使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。



在下文中一共展示了InitWindow函数的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C++代码示例。

示例1: Test26

void Test26()
{
	LoadBCP("data.bcp"); InitWindow();
	ImGuiImpl_Init();

	float angle, vec[3];
	const char *lbs[] = {"Red", "Green", "Blue"};
	int lbc = 0;

	while(!appexit)
	{
		ImGuiImpl_NewFrame();
		ImGui::Text("Hello, world!");
		ImGui::InputFloat3("Vector3", vec);
		ImGui::SliderAngle("Angle", &angle);
		ImGui::ListBox("List box", &lbc, lbs, 3, -1);
		BeginDrawing();
		renderer->InitImGuiDrawing();
		ImGui::Render();
		EndDrawing();
		HandleWindow();
	}
}
开发者ID:AdrienTD,项目名称:wkbre,代码行数:23,代码来源:test.cpp


示例2: Test25

void Test25()
{
	LoadBCP("data.bcp"); InitWindow();

	float x1 = 0, x2 = 0;
	texture t1, t2, t3;
	t1 = GetTexture("Interface\\FrontEnd\\Background_Scroll_1.tga");
	t2 = GetTexture("Interface\\FrontEnd\\Background_Scroll_2.tga");
	t3 = GetTexture("Interface\\FrontEnd\\Background_Static_2.tga");

	while(!appexit)
	{
		BeginDrawing();
		InitRectDrawing();
		SetTexture(0, t1); DrawRect(0, 0, scrw, scrh, -1, x1, 0, 1, 1);
		SetTexture(0, t2); DrawRect(0, 0, scrw, scrh, -1, x2, 0, 1, 1);
		SetTexture(0, t3); DrawRect(0, 0, scrw, scrh, -1, 0, 0, 1, 1);
		x1 += 0.0003f; x2 -= 0.0003f;
		if(x1 >= 1) x1 -= 1; if(x2 < 0) x2 += 1;
		EndDrawing();
		HandleWindow();
	}
}
开发者ID:AdrienTD,项目名称:wkbre,代码行数:23,代码来源:test.cpp


示例3: InitConfig

bool wd::Application::Initialize(
	const HINSTANCE& hInstance,
	const int& nCmdShow)
{
	// Init config file - get global settings.
	InitConfig();

	// Create OS window.
	if (!InitWindow(hInstance, nCmdShow))
		return false;

	// Create video device and context.
	if (!InitVideoDevice())
		return false;

	InitInput();
	// Show window. By now we should be able to show some sort of loading screen.
	m_pWindow->Show();
	// Create scene.
	InitScene();

	return true;
}
开发者ID:WinterDog,项目名称:Shegelmetris,代码行数:23,代码来源:Application.cpp


示例4: InitRootNode

//////////////////
//Init Functions//
/////////////////
void AsteroidGame::Init(void){
	input_manager_ = NULL;
	keyboard_ = NULL;
	mouse_ = NULL;

	/* Run all initialization steps */
    InitRootNode();
    InitPlugins();
    InitRenderSystem();
    InitWindow();
    InitViewport();
	InitEvents();
	InitOIS();
	LoadMaterials();

	InitManagers();
	


	iAsteroidManager->createAsteroidField();

	iGameState = GameState::Running;
}
开发者ID:Untamedhawk,项目名称:Comp3501,代码行数:26,代码来源:AsteroidGame.cpp


示例5: dbg_msg

bool CGraphics_SDL::Init()
{
	{
		int Systems = SDL_INIT_VIDEO;

		if(g_Config.m_SndEnable)
			Systems |= SDL_INIT_AUDIO;

		if(g_Config.m_ClEventthread)
			Systems |= SDL_INIT_EVENTTHREAD;

		if(SDL_Init(Systems) < 0)
		{
			dbg_msg("gfx", "unable to init SDL: %s", SDL_GetError());
			return true;
		}
	}

	atexit(SDL_Quit); // ignore_convention

	#ifdef CONF_FAMILY_WINDOWS
		if(!getenv("SDL_VIDEO_WINDOW_POS") && !getenv("SDL_VIDEO_CENTERED")) // ignore_convention
			putenv("SDL_VIDEO_WINDOW_POS=8,27"); // ignore_convention
	#endif

	if(InitWindow() != 0)
		return true;

	SDL_ShowCursor(0);

	m_fpCallback = 0;

	CGraphics_OpenGL::Init();

	MapScreen(0,0,g_Config.m_GfxScreenWidth, g_Config.m_GfxScreenHeight);
	return false;
}
开发者ID:Kebein,项目名称:teeworlds,代码行数:37,代码来源:graphics.cpp


示例6: wWinMain

//--------------------------------------------------------------------------------------
// Entry point to the program. Initializes everything and goes into a message processing 
// loop. Idle time is used to render the scene.
//--------------------------------------------------------------------------------------
int WINAPI wWinMain( HINSTANCE hInstance, HINSTANCE hPrevInstance, LPWSTR lpCmdLine, int nCmdShow )
{
    UNREFERENCED_PARAMETER( hPrevInstance );
    UNREFERENCED_PARAMETER( lpCmdLine );

    if( FAILED( InitWindow( hInstance, nCmdShow ) ) )
        return 0;

    if( FAILED( InitDevice() ) )
    {
        CleanupDevice();
        return 0;
    }

	// JPE: Inicia contadores globales
	tIni = timeGetTime();
	tAnt = tIni;

    // Main message loop
    MSG msg = {0};
    while( WM_QUIT != msg.message )
    {
        if( PeekMessage( &msg, NULL, 0, 0, PM_REMOVE ) )
        {
            TranslateMessage( &msg );
            DispatchMessage( &msg );
        }
        else
        {
            Render();
        }
    }

    CleanupDevice();

    return ( int )msg.wParam;
}
开发者ID:jpechevarria,项目名称:lab,代码行数:41,代码来源:Tutorial05.cpp


示例7: GetAppConfig

// ³ÌÐò³õʼ»¯
int CAppBase::Init(HINSTANCE hInstance)
{
	int result = 0;
	GAppHandle = this;
	GetAppConfig();
	
	m_pTANGEngine = new TANGEngine(hInstance);



	result = InitWindow(hInstance);
	if (E_FAILED == result)
	{
		return E_FAILED;
	}
	result = m_pTANGEngine->Init(m_hWnd, NULL, m_iScreenWidth, m_iScreenHeight, 0, true);

	if (E_FAILED == result)
	{
		return E_FAILED;
	}

	return E_SUCCESS;
}
开发者ID:954818696,项目名称:TANGEngine,代码行数:25,代码来源:AppBase.cpp


示例8: wWinMain

//--------------------------------------------------------------------------------------
// Entry point to the program. Initializes everything and goes into a message processing 
// loop. Idle time is used to render the scene.
//--------------------------------------------------------------------------------------
int WINAPI wWinMain( HINSTANCE hInstance, HINSTANCE hPrevInstance, LPWSTR lpCmdLine, int nCmdShow )
{
    UNREFERENCED_PARAMETER( hPrevInstance );
    UNREFERENCED_PARAMETER( lpCmdLine );
	
	GEngine = new Engine;
    
	if( FAILED( InitWindow( hInstance, nCmdShow ) ) )
        return 0;

    if( FAILED( InitDevice() ) )
    {
        CleanupDevice();
        return 0;
    }

    // Main message loop
    MSG msg = {0};
    while( WM_QUIT != msg.message )
    {
        if( PeekMessage( &msg, NULL, 0, 0, PM_REMOVE ) )
        {
            TranslateMessage( &msg );
            DispatchMessage( &msg );
        }
        else
        {
			GEngine->Tick();
            Render();
        }
    }

    CleanupDevice();

    return ( int )msg.wParam;
}
开发者ID:kulkal,项目名称:project,代码行数:40,代码来源:Client.cpp


示例9: xml

LRESULT CSDKLoginUIMgr::HandleMessage(UINT uMsg, WPARAM wParam, LPARAM lParam)
{
	LRESULT lRes = 0;
	BOOL bHandled = TRUE;

	if( uMsg == WM_CREATE ) 
	{
		m_PaintManager.Init(m_hWnd);

		CDialogBuilder builder;
		STRINGorID xml(GetSkinRes());
		CControlUI* pRoot = builder.Create(xml, _T("xml"), 0, &m_PaintManager);
		ASSERT(pRoot && "Failed to parse XML");

		m_PaintManager.AttachDialog(pRoot);
		m_PaintManager.AddNotifier(this);
		InitWindow(); 

		return lRes;
	}
	else if (uMsg == WM_CLOSE)
	{
		OnClose(uMsg, wParam, lParam, bHandled);		
	}
	else if (uMsg == WM_DESTROY)
	{
		OnDestroy(uMsg, wParam, lParam, bHandled);		
	}

	if( m_PaintManager.MessageHandler(uMsg, wParam, lParam, lRes) ) 
	{
		return lRes;
	}

	return __super::HandleMessage(uMsg, wParam, lParam);
}
开发者ID:zoomvideo,项目名称:Windows,代码行数:36,代码来源:LOGIN_sdk_login_UI.cpp


示例10: InitRootNode

void OgreApplication::Init(void){

	/* Set default values for the variables */
	animating_ = false;
	space_down_ = false;
	animation_state_ = NULL;
	input_manager_ = NULL;
	keyboard_ = NULL;
	mouse_ = NULL;

	// For particles
	timer_ = 0.0;
	animating_particles_ = true;

	/* Run all initialization steps */
    InitRootNode();
    InitPlugins();
    InitRenderSystem();
    InitWindow();
    InitViewport();
	InitEvents();
	InitOIS();
	LoadMaterials();
}
开发者ID:FanZhang10,项目名称:effect2,代码行数:24,代码来源:ogre_application.cpp


示例11: InitWindow

void HelloGUI::Start()
{
    // Execute base class startup
    Sample::Start();

    // Enable OS cursor
    GetSubsystem<Input>()->SetMouseVisible(true);

    // Load XML file containing default UI style sheet
    ResourceCache* cache = GetSubsystem<ResourceCache>();
    XMLFile* style = cache->GetResource<XMLFile>("UI/DefaultStyle.xml");

    // Set the loaded style as default style
    uiRoot_->SetDefaultStyle(style);

    // Initialize Window
    InitWindow();

    // Create and add some controls to the Window
    InitControls();

    // Create a draggable Fish
    CreateDraggableFish();
}
开发者ID:nonconforme,项目名称:Urho3D,代码行数:24,代码来源:HelloGUI.cpp


示例12: draw_loading

void 
draw_loading()
{
  draw_background(0);

  draw_icon(ICON_FINDER, ICON_X1, ICON_Y);
  draw_string(ICON_X1 + 12, ICON_STRING_Y, "FINDER", FONT_COLOR);
  draw_icon(ICON_PHOTO, ICON_X2, ICON_Y);
  draw_string(ICON_X2 + 12, ICON_STRING_Y, "PHOTO", FONT_COLOR);
  draw_icon(ICON_TEXT, ICON_X3, ICON_Y);
  draw_string(ICON_X3 + 20, ICON_STRING_Y, "TEXT", FONT_COLOR);
  draw_icon(ICON_GAME, ICON_X4, ICON_Y);
  draw_string(ICON_X4 + 17, ICON_STRING_Y, "GAME", FONT_COLOR);
  draw_icon(ICON_DRAW, ICON_X5, ICON_Y);
  draw_string(ICON_X5 + 17, ICON_STRING_Y, "DRAW", FONT_COLOR);
  draw_icon(ICON_SETTING, ICON_X6, ICON_Y);
  draw_string(ICON_X6 + 8, ICON_STRING_Y, "SETTING", FONT_COLOR);

  display_to_screen(0, 0, SCREEN_WIDTH, SCREEN_HEIGHT);
  draw_mouse(ori_x_mouse, ori_y_mouse);

  InitNode();
  InitWindow();
}
开发者ID:treejames,项目名称:xv6,代码行数:24,代码来源:gui.c


示例13: Test24

void Test24()
{
	LoadBCP("data.bcp");
	InitWindow();
	Anim tm("Warrior Kings Game Set\\Characters\\Abaddon\\GRAB1.ANIM3");
	//Anim tm("Warrior Kings Game Set\\Characters\\Michael\\SPECIALMOVE.ANIM3");
	RBatch *batch = renderer->CreateBatch(16384, 16384);

	Matrix m1, m2;
	CreateScaleMatrix(&m1, 1.5, 1.5, 1.5);
	CreateTranslationMatrix(&m2, 0, -4, 0);
	mWorld = m1 * m2;

	while(!appexit)
	{
		BeginDrawing();
		BeginMeshDrawing();
		renderer->BeginBatchDrawing();
		batch->begin();
		SetModelMatrices();
		//CreateIdentityMatrix(&mWorld);


		//tm.mesh->draw(1);
		//tn.draw(2);

		//tm.drawInBatch(batch, 0, 1, -1, 0);
		//batch->flush();

		DrawAnim(&tm, batch, 1, timeGetTime());
		batch->end();

		EndDrawing();
		HandleWindow();
	}
}
开发者ID:AdrienTD,项目名称:wkbre,代码行数:36,代码来源:test.cpp


示例14: Test17

void Test17()
{
	LoadBCP("data.bcp"); ReadLanguageFile(); InitWindow();
	LoadSaveGame("Save_Games\\rescript1.sav");

	SequenceEnv se; char inbuf[256];

	printf("Equations:\n");
	for(int i = 0; i < strEquation.len; i++)
		printf(" %i: %s\n", i+1, strEquation.getdp(i));

	while(1)
	{
		printf("\nEquation number: ");
		int x = atoi(fgets(inbuf, 255, stdin))-1;
		if(x == -1) break;
		if((uint)x >= strEquation.len)
			printf("Eq. number does not exist.\n");
		else if(!equation[x])
			printf("Equation is null.\n");
		else
			printf("Result: %f\n", equation[x]->get(&se));
	}
};
开发者ID:AdrienTD,项目名称:wkbre,代码行数:24,代码来源:test.cpp


示例15: main

int main(int argc, char **argv)
{
	if (argc != 2) {
		cout << "How to use: HTRViewer htrfile.htr\n";
		return 0;
	}

	string htrfile = argv[1];

	glutInit(&argc, argv);
	glutInitDisplayMode(GLUT_DEPTH | GLUT_DOUBLE | GLUT_RGBA);
	glutInitWindowPosition(100,100);
	glutInitWindowSize(500,500);
	string windowName = "HTR Viewer " + htrfile;
	glutCreateWindow(windowName.c_str());

	// register all callbacks
	InitWindow();
	InitScene(htrfile.c_str());

	glutMainLoop();

	return(0);
}
开发者ID:arifsetiawan,项目名称:htrviewer,代码行数:24,代码来源:aMain.cpp


示例16: switch

LRESULT WindowImplBase::OnCreate(UINT uMsg, WPARAM wParam, LPARAM lParam, BOOL& bHandled)
{
	LONG styleValue = ::GetWindowLong(*this, GWL_STYLE);
	styleValue &= ~WS_CAPTION;
	::SetWindowLong(*this, GWL_STYLE, styleValue | WS_CLIPSIBLINGS | WS_CLIPCHILDREN);
	RECT rcClient;
	::GetClientRect(*this, &rcClient);
	::SetWindowPos(*this, NULL, rcClient.left, rcClient.top, rcClient.right - rcClient.left, \
		rcClient.bottom - rcClient.top, SWP_FRAMECHANGED);

	m_PaintManager.Init(m_hWnd);
	m_PaintManager.AddPreMessageFilter(this);

	CDialogBuilder builder;
	CDuiString strResourcePath=m_PaintManager.GetResourcePath();
	if (strResourcePath.IsEmpty())
	{
		strResourcePath=m_PaintManager.GetInstancePath();
		strResourcePath+=GetSkinFolder().GetData();
	}
	m_PaintManager.SetResourcePath(strResourcePath.GetData());

	switch(GetResourceType())
	{
	case UILIB_ZIP:
		m_PaintManager.SetResourceZip(GetZIPFileName().GetData(), true);
		break;
	case UILIB_ZIPRESOURCE:
		{
			HRSRC hResource = ::FindResource(m_PaintManager.GetResourceDll(), GetResourceID(), _T("ZIPRES"));
			if( hResource == NULL )
				return 0L;
			DWORD dwSize = 0;
			HGLOBAL hGlobal = ::LoadResource(m_PaintManager.GetResourceDll(), hResource);
			if( hGlobal == NULL ) 
			{
#if defined(WIN32) && !defined(UNDER_CE)
				::FreeResource(hResource);
#endif
				return 0L;
			}
			dwSize = ::SizeofResource(m_PaintManager.GetResourceDll(), hResource);
			if( dwSize == 0 )
				return 0L;
			m_lpResourceZIPBuffer = new BYTE[ dwSize ];
			if (m_lpResourceZIPBuffer != NULL)
			{
				::CopyMemory(m_lpResourceZIPBuffer, (LPBYTE)::LockResource(hGlobal), dwSize);
			}
#if defined(WIN32) && !defined(UNDER_CE)
			::FreeResource(hResource);
#endif
			m_PaintManager.SetResourceZip(m_lpResourceZIPBuffer, dwSize);
		}
		break;
	}

	CControlUI* pRoot=NULL;
	if (GetResourceType()==UILIB_RESOURCE)
	{
		STRINGorID xml(_ttoi(GetSkinFile().GetData()));
		pRoot = builder.Create(xml, _T("xml"), this, &m_PaintManager);
	}
	else
		pRoot = builder.Create(GetSkinFile().GetData(), (UINT)0, this, &m_PaintManager);
	ASSERT(pRoot);
	if (pRoot==NULL)
	{
		MessageBox(NULL,_T("加载资源文件失败"),_T("Duilib"),MB_OK|MB_ICONERROR);
		ExitProcess(1);
		return 0;
	}
	m_PaintManager.AttachDialog(pRoot);
	m_PaintManager.AddNotifier(this);

	InitWindow();
	return 0;
}
开发者ID:2php,项目名称:duilib,代码行数:78,代码来源:WinImplBase.cpp


示例17: main

int main()
{    
    // Initialization
    //--------------------------------------------------------------------------------------
    int screenWidth = 800;
    int screenHeight = 450;

    InitWindow(screenWidth, screenHeight, "Floppy Bird");
    
    InitAudioDevice();      // Initialize audio device
    
    Sound coin = LoadSound("resources/coin.wav");
    Sound jump = LoadSound("resources/jump.wav");
    
    Texture2D background = LoadTexture("resources/background.png");
    Texture2D tubes = LoadTexture("resources/tubes.png");
    Texture2D floppy = LoadTexture("resources/floppy.png");
    
    Vector2 floppyPos = { 80, screenHeight/2 - floppy.height/2 };
    
    Vector2 tubesPos[MAX_TUBES];
    int tubesSpeedX = 2;
    
    for (int i = 0; i < MAX_TUBES; i++)
    {
        tubesPos[i].x = 400 + 280*i;
        tubesPos[i].y = -GetRandomValue(0, 120);
    }
    
    Rectangle tubesRecs[MAX_TUBES*2];
    bool tubesActive[MAX_TUBES];
    
    for (int i = 0; i < MAX_TUBES*2; i += 2)
    {
        tubesRecs[i].x = tubesPos[i/2].x;
        tubesRecs[i].y = tubesPos[i/2].y;
        tubesRecs[i].width = tubes.width;
        tubesRecs[i].height = 255;
        
        tubesRecs[i+1].x = tubesPos[i/2].x;
        tubesRecs[i+1].y = 600 + tubesPos[i/2].y - 255;
        tubesRecs[i+1].width = tubes.width;
        tubesRecs[i+1].height = 255;
        
        tubesActive[i/2] = true;
    }
 
    int backScroll = 0;
    
    int score = 0;
    int hiscore = 0;
    
    bool gameover = false;
    bool superfx = false;
    
    SetTargetFPS(60);
    //---------------------------------------------------------------------------------------
    
    // Main game loop
    while (!WindowShouldClose())    // Detect window close button or ESC key
    {
        // Update
        //----------------------------------------------------------------------------------
        backScroll--;
        
        if (backScroll <= -800) backScroll = 0; 
        
        for (int i = 0; i < MAX_TUBES; i++) tubesPos[i].x -= tubesSpeedX;
        
        for (int i = 0; i < MAX_TUBES*2; i += 2)
        {
            tubesRecs[i].x = tubesPos[i/2].x;
            tubesRecs[i+1].x = tubesPos[i/2].x;
        }

        if (IsKeyDown(KEY_SPACE) && !gameover) floppyPos.y -= 3;
        else floppyPos.y += 1;
        
        if (IsKeyPressed(KEY_SPACE) && !gameover) PlaySound(jump);
        
        // Check Collisions
        for (int i = 0; i < MAX_TUBES*2; i++)
        {
            if (CheckCollisionCircleRec((Vector2){ floppyPos.x + floppy.width/2, floppyPos.y + floppy.height/2 }, floppy.width/2, tubesRecs[i])) 
            {
                gameover = true;
            }
            else if ((tubesPos[i/2].x < floppyPos.x) && tubesActive[i/2] && !gameover)
            {
                score += 100;
                tubesActive[i/2] = false;
                PlaySound(coin);
                
                superfx = true;
                
                if (score > hiscore) hiscore = score;
            }
        }
        
        if (gameover && IsKeyPressed(KEY_ENTER))
//.........这里部分代码省略.........
开发者ID:MarcMDE,项目名称:raylib,代码行数:101,代码来源:floppy.c


示例18: WinMain

int WINAPI WinMain(HINSTANCE hInstance,
    HINSTANCE hPrevInstance,
    LPSTR lpCmdLine,
    int nCmdShow)
{
	startup_time = GetTickCount();
	previous_time = 0;
	frames = 0;
	fps = 1;
#ifdef _DEBUG_TIMINGS
	drawtime = 0;
	drawtime_prv = 0;
	drawtime_med = 1;
	cleartime = 0;
	cleartime_prv = 0;
	cleartime_med = 1;
	mainlooptime = 0;
	mainlooptime_prv = 0;
	mainlooptime_med = 1;
	fliptime = 0;
	fliptime_prv = 0;
	fliptime_med = 1;
#endif
	current_state = GAME_MAINMENU;
	difficulty_pick = 0;
	size_pick = 0;
	race_pick = 0;
	opponents_pick = 0;
	mouseX = 0;
	mouseY = 0;
	mouse[0] = false;
	mouse[1] = false;
	mouse[2] = false;
	tex_count = 0;
	font_count = 0;
	srand((unsigned)time(NULL));

	LogToFile("Log started");
	InitWindow(hInstance);
	InitPaths();
	InitTextures();
	InitFonts();
	InitStorages();
	InitDefinitions();
	InitGUI();
	InitOGLSettings();
	ResizeScene(cfg.scr_width, cfg.scr_height);
	LogPaths();

	//Load_v_03("test.txt");
	Load_v_04("test.txt");
	while(current_state != GAME_EXITING)
	{
		MainLoop();
		ClearScene();
		DrawScene();
		Flip(&hDC);
	}

	// Now terminating all
	KillWindow(hInstance);

	LogToFile("Finished logging");




}
开发者ID:lightsgoout,项目名称:interview,代码行数:68,代码来源:openorion.cpp


示例19: main

int main(void)
{
    // Initialization
    //--------------------------------------------------------------------------------------
    const int screenWidth = 800;
    const int screenHeight = 450;

    InitWindow(screenWidth, screenHeight, "raylib [text] example - sprite fonts usage");

    const char msg1[50] = "THIS IS A custom SPRITE FONT...";
    const char msg2[50] = "...and this is ANOTHER CUSTOM font...";
    const char msg3[50] = "...and a THIRD one! GREAT! :D";

    // NOTE: Textures/Fonts MUST be loaded after Window initialization (OpenGL context is required)
    Font font1 = LoadFont("resources/custom_mecha.png");          // Font loading
    Font font2 = LoadFont("resources/custom_alagard.png");        // Font loading
    Font font3 = LoadFont("resources/custom_jupiter_crash.png");  // Font loading

    Vector2 fontPosition1 = { screenWidth/2 - MeasureTextEx(font1, msg1, font1.baseSize, -3).x/2,
                              screenHeight/2 - font1.baseSize/2 - 80 };

    Vector2 fontPosition2 = { screenWidth/2 - MeasureTextEx(font2, msg2, font2.baseSize, -2).x/2,
                              screenHeight/2 - font2.baseSize/2 - 10 };

    Vector2 fontPosition3 = { screenWidth/2 - MeasureTextEx(font3, msg3, font3.baseSize, 2).x/2,
                              screenHeight/2 - font3.baseSize/2 + 50 };

    SetTargetFPS(60);               // Set our game to run at 60 frames-per-second
    //--------------------------------------------------------------------------------------

    // Main game loop
    while (!WindowShouldClose())    // Detect window close button or ESC key
    {
        // Update
        //----------------------------------------------------------------------------------
        // TODO: Update variables here...
        //----------------------------------------------------------------------------------

        // Draw
        //----------------------------------------------------------------------------------
        BeginDrawing();

            ClearBackground(RAYWHITE);

            DrawTextEx(font1, msg1, fontPosition1, font1.baseSize, -3, WHITE);
            DrawTextEx(font2, msg2, fontPosition2, font2.baseSize, -2, WHITE);
            DrawTextEx(font3, msg3, fontPosition3, font3.baseSize, 2, WHITE);

        EndDrawing();
        //----------------------------------------------------------------------------------
    }

    // De-Initialization
    //--------------------------------------------------------------------------------------
    UnloadFont(font1);      // Font unloading
    UnloadFont(font2);      // Font unloading
    UnloadFont(font3);      // Font unloading

    CloseWindow();                // Close window and OpenGL context
    //--------------------------------------------------------------------------------------

    return 0;
}
开发者ID:raysan5,项目名称:raylib,代码行数:63,代码来源:text_sprite_fonts.c


示例20: request_

	ScriptDialogWidget::ScriptDialogWidget(ScriptDialogRequest &request, Foundation::Framework *framework, QWidget *parent) : request_(request)
	{
		InitWindow(request_);
	}
开发者ID:caocao,项目名称:naali,代码行数:4,代码来源:ScriptDialogWidget.cpp



注:本文中的InitWindow函数示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
C++ InitWindowStyles函数代码示例发布时间:2022-05-30
下一篇:
C++ InitWin函数代码示例发布时间:2022-05-30
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap