当前位置: 首页>>代码示例>>C++>>正文


C++ InitWindow函数代码示例

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


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


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