Stilllegung des Forums
Das Forum wurde am 05.06.2023 nach über 20 Jahren stillgelegt (weitere Informationen und ein kleiner Rückblick).
Registrierungen, Anmeldungen und Postings sind nicht mehr möglich. Öffentliche Inhalte sind weiterhin zugänglich.
Das Team von spieleprogrammierer.de bedankt sich bei der Community für die vielen schönen Jahre.
Wenn du eine deutschsprachige Spieleentwickler-Community suchst, schau doch mal im Discord und auf ZFX vorbei!
Werbeanzeige
Anonymous
unregistriert
C-/C++-Quelltext |
|
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 |
m_GUISkin.pSkinTexture = tbTextureManager::GetTexture("Data\\GUI.bmp", TRUE, D3DX_DEFAULT, D3DX_DEFAULT, 1, D3DFMT_UNKNOWN, 0, D3DPOOL_MANAGED, D3DX_DEFAULT, D3DX_DEFAULT, D3DCOLOR_XRGB(255, 0, 255)); m_GUISkin.pEffect = new tbEffect; m_GUISkin.pEffect->Init("Data\\GUI.fx"); m_GUISkin.pEffect->GetEffect()->SetTexture("Texture", m_GUISkin.pSkinTexture); m_GUISkin.pFont = g_pBreakanoid->m_pFont2; m_GUISkin.vCursorSize = tbVector2(32.0f, 32.0f); m_GUISkin.CursorColor1 = tbColor(1.0f, 1.0f, 1.0f, 0.75f); m_GUISkin.CursorColor2 = tbColor(1.0f, 1.0f, 1.0f, 0.75f); m_GUISkin.vCursorHotSpot = tbVector2(1.0f, 1.0f); m_GUISkin.fCursorSpeed = 500.0f; m_GUISkin.EnabledColor = tbColor(1.0f, 1.0f, 1.0f, 0.5f); m_GUISkin.DisabledColor = tbColor(1.0f, 1.0f, 1.0f, 0.25f); m_GUISkin.HighlightColor = tbColor(1.0f, 1.0f, 1.0f, 0.75f); m_GUISkin.vTextSize = tbVector2(1.0f); m_GUISkin.EnabledTextColor = tbColor(1.0f, 1.0f, 1.0f, 0.75f); m_GUISkin.DisabledTextColor = tbColor(1.0f, 1.0f, 1.0f, 0.25f); m_GUISkin.HighlightTextColor = tbColor(1.0f, 1.0f, 1.0f, 1.0f); if(m_GUISkin.pSkinTexture == NULL) TB_ERROR("Fehler beim Laden der Skin-Textur für die Benutzeroberfläche!", TB_ERROR); if(m_GUISkin.pEffect == NULL) TB_ERROR("Fehler beim Laden des Effekts für die Benutzeroberfläche!", TB_ERROR); // Benutzeroberfläche erstellen m_pGUI = new tbGUI; if(m_pGUI->Init(&m_GUISkin, MainMenuMsgProc, tbVector2(800.0f, 600.0f), tbDirect3D::GetScreenSize() / tbVector2(800.0f, 600.0f))) m_pGUI->CreateButton(101, 0, tbVector2(5.0f, 5.0f), tbVector2(120.0f, 40.0f), "Hilfe"); m_pGUI->CreateButton(102, 0, tbVector2(130.0f, 5.0f), tbVector2(120.0f, 40.0f), "Steuerung"); m_pGUI->CreateButton(103, 0, tbVector2(260.0f, 5.0f), tbVector2(120.0f, 40.0f), "Spiel beenden"); m_pGUI->CreateFrame(104, 0, tbVector2(230.0f, 500.0f), tbVector2(520.0f, 90.0f)); m_pGUI->CreateText(105, 0, tbVector2(250.0f, 520.0f), "Text"); m_pGUI->CreateFrame(106, 0, tbVector2(5.0f, 450.0f), tbVector2(210.0f, 140.0f)); |
C-/C++-Quelltext |
|
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 |
tbResult MainMenuMsgProc(int iID, tbGUIMessage* pMsg, tbGUI* pGUI) { switch(pMsg->Type) { case TB_GMT_ELEMENTCLICKED: switch(iID) { case 102: // Steuerung pGUI->SetCurrentPage(1); break; case 103: // Spiel beenden PostQuitMessage(0); break; } } return TB_OK; } |
C-/C++-Quelltext |
|
1 |
m_pGUI->Render(fTime); |
C-/C++-Quelltext |
|
1 |
m_pGUI->Move(fTime, g_pbButtons, g_pfButtons); |
C-/C++-Quelltext |
|
1 2 3 4 5 6 7 8 |
// DirectInput initialisieren if(tbDirectInput::Init(NULL, DISCL_FOREGROUND | (m_Config.Direct3D.bWindowed ? DISCL_NONEXCLUSIVE : DISCL_EXCLUSIVE))) { // Fehler! TB_ERROR("DirectInput konnte nicht initialisiert werden!", TB_ERROR); } |
Anonymous
unregistriert
C-/C++-Quelltext |
|
1 |
ShowWindow( tbDirect3D::GetWindow(),SW_SHOWMAXIMIZED); |
Werbeanzeige