Wrote a lot of the tutorial; Minor changes

This commit is contained in:
grayson committed 2021-12-07 13:19:21 -06:00
1 parent 21764d3f98
commit 8c67ceb5a4
14 files changed
+231 -25

No files matched your search

+3
View File
@@ -24,6 +24,9 @@ namespace nf {
if (physics)
app->getPhysicsEngine()->newScene();
setAmbientLight(0.1f);
NFTimerLoad;
onEnter();
+2 -3
View File
@@ -6,11 +6,10 @@
namespace nf {
void IntroGamestate::onEnter() {
NFLog("Intro onEnter!");
m_scale = 2.0;
m_logoTex.create(BaseAssets::logo, Vec2(0.0, 0.0));
m_logoTex.centered(true, true);
m_text.create("(c) Grayson Riffe 2021", Vec2(0.01f, 0.025f), Vec3(0.8f));
m_text.create("(c) Grayson Riffe 2021 | graysonriffe.com", Vec2(0.01f, 0.025f), Vec3(0.8f));
m_text.setScale(0.6f);
m_start = std::chrono::steady_clock::now();
}
@@ -37,6 +36,6 @@ namespace nf {
}
void IntroGamestate::onExit() {
NFLog("Intro onExit!");
}
}
+1 -1
View File
@@ -89,7 +89,7 @@ namespace nf {
Timer::~Timer() {
std::chrono::duration<float> dur = std::chrono::steady_clock::now() - m_initTime;
if (!m_loading)
NFLog("\"" + m_funcName + (std::string)"\" took " + std::to_string(dur.count()) + (std::string)" seconds.");
NFLog("\"" + m_funcName + (std::string)"\" took " + std::to_string(dur.count() * 1000.0f) + (std::string)" ms.");
else
NFLog("Loading took " + std::to_string(dur.count()) + (std::string)" seconds.");
}
+1 -1
View File
@@ -17,7 +17,7 @@ namespace nf {
* texture.
*
* @sa @ref customButtons
* @ref createUI
* @ref createUITut
*/
class Button : public UIElement, public NFObject {
public:
+2 -1
View File
@@ -11,7 +11,8 @@ namespace nf {
*
* A cubemap is a cube with a texture on each one of its 6 sides.
*
* @sa @ref createCubemap @ref customCubemap
* @sa @ref createCubemapTut
* @ref customCubemap
*/
class Cubemap : public Drawable, public NFObject {
public:
+4 -4
View File
@@ -52,20 +52,20 @@ bool Debug::m_timerStarted = false
#define NFError(x) {nf::Debug::ErrorImp(x,__FILENAME__, __LINE__);\
__debugbreak();}
/**
* A timer useful for timing functions
* Times how long functions or scopes take to execute in milliseconds
*
* To time a function, place this macro at the beginning of it:
*
* ~~~
* void myFunc() {
* NFTimer;
* NFTimeFunc;
* //Rest of function to be timed...
* } //Prints here
* ~~~
*
* The result will be logged when the scope it's declared in ends.
*/
#define NFTimer nf::Timer _nfTimer(__func__)
#define NFTimeFunc nf::Timer _nfTimer(__func__)
/**
* @}
*/
@@ -109,7 +109,7 @@ __debugbreak();}
#define NFLog(x)
#define NFError(x) {MessageBox(FindWindow(L"NFClass", NULL), toWide(x).data(), L"NF Engine Error", MB_OK | MB_ICONERROR);\
std::exit(-1);}
#define NFTimer
#define NFTimeFunc
#define NFTimerLoad
#endif