Skip to content

Commit

Permalink
Merge pull request #886 from lairworks/fixTestGraphicsConfigStartup
Browse files Browse the repository at this point in the history
Fix startup error by setting default config values
  • Loading branch information
DanRStevens authored Jun 25, 2021
2 parents dab9213 + ed3afd7 commit 3a8be9f
Showing 1 changed file with 29 additions and 0 deletions.
29 changes: 29 additions & 0 deletions test-graphics/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,9 @@
#include "TestGraphics.h"

#include <NAS2D/Game.h>
#include <NAS2D/Utility.h>
#include <NAS2D/Configuration.h>
#include <NAS2D/Dictionary.h>

#include <iostream>
#include <string>
Expand All @@ -20,6 +23,32 @@ int main(int /*argc*/, char *argv[])
{
try
{
NAS2D::Utility<NAS2D::Configuration>::init(
std::map<std::string, NAS2D::Dictionary>{
{
"graphics",
{{
{"screenwidth", 1000},
{"screenheight", 700},
{"bitdepth", 32},
{"fullscreen", false},
{"vsync", true}
}}
},
{
"audio",
{{
{"mixer", "SDL"},
{"musicvolume", 100},
{"sfxvolume", 128},
{"channels", 2},
{"mixrate", 22050},
{"bufferlength", 1024}
}}
}
}
);

NAS2D::Game game("NAS2D Graphics Test", "NAS2D_GraphicsTest", "LairWorks", argv[0]);
game.go(new TestGraphics());
}
Expand Down

0 comments on commit 3a8be9f

Please sign in to comment.