Client builds & runs, can't test the gameplay without the server
SDL_ttf is now being initialized, and all usages of fonts are now checked for nullptr. A bug where the renderer's logical size was not properly set has been fixed. The FPS counter is disabled for now.
This commit is contained in:
@@ -42,6 +42,13 @@ LobbyMenu::LobbyMenu(int* const argClientIndex, int* const argAccountIndex):
|
||||
buttonImage.Load(GetRenderer(), config["dir.interface"] + "button.png");
|
||||
font = TTF_OpenFont(config["client.font"].c_str(), 12);
|
||||
|
||||
//check that the font loaded
|
||||
if (!font) {
|
||||
std::ostringstream msg;
|
||||
msg << "Failed to load a font file; " << SDL_GetError();
|
||||
throw(std::runtime_error(msg.str()));
|
||||
}
|
||||
|
||||
//setup the buttons
|
||||
searchButton.SetBackgroundTexture(GetRenderer(), buttonImage.GetTexture());
|
||||
searchButton.SetText(GetRenderer(), font, "Search", {255, 255, 255, 255});
|
||||
|
||||
Reference in New Issue
Block a user