|
@@ -1,64 +1,14 @@
|
|
|
#define IMPORT_CORE
|
|
|
-#include <GLFW/glfw3.h>
|
|
|
#include <core/Logger.h>
|
|
|
#include <core/Utility.h>
|
|
|
-#include <stdio.h>
|
|
|
#include <string.h>
|
|
|
|
|
|
#include "Tests.h"
|
|
|
-#include "core/Window.h"
|
|
|
-
|
|
|
-static int ticks = 200;
|
|
|
-static Button closeButton = 0;
|
|
|
-static Button testButton = 0;
|
|
|
-
|
|
|
-static bool isRunning(void*) {
|
|
|
- return !shouldWindowClose() && ticks > 0 && !coreControlsDown(closeButton);
|
|
|
-}
|
|
|
-
|
|
|
-static void tick(void*) {
|
|
|
- ticks -= ticks > 0;
|
|
|
- printf("TPS: %.3f\nFPS: %.3f\n", (double)getWindowTicksPerSecond(),
|
|
|
- (double)getWindowFramesPerSecond());
|
|
|
- printf("%12s | Down: %d | DownTime: %3d | Released: %d\n",
|
|
|
- coreControlsName(closeButton), coreControlsDown(closeButton),
|
|
|
- coreControlsDownTime(closeButton),
|
|
|
- coreControlsReleased(closeButton));
|
|
|
- printf("%12s | Down: %d | DownTime: %3d | Released: %d\n",
|
|
|
- coreControlsName(testButton), coreControlsDown(testButton),
|
|
|
- coreControlsDownTime(testButton), coreControlsReleased(testButton));
|
|
|
-
|
|
|
- Vector2 mouse = coreControlsLastMousePosition();
|
|
|
- printf("Mouse: %.2f %.2f\n", (double)mouse.data[0], (double)mouse.data[1]);
|
|
|
-}
|
|
|
-
|
|
|
-static void render(void*, float) {
|
|
|
-}
|
|
|
-
|
|
|
-static void testWindow(void) {
|
|
|
- WindowOptions options = {{{800, 480}}, false, "Test"};
|
|
|
- if(openWindow(&options)) {
|
|
|
- return;
|
|
|
- }
|
|
|
-
|
|
|
- closeButton = coreControlsAdd("Close Button");
|
|
|
- coreControlsBindKey(closeButton, GLFW_KEY_Q);
|
|
|
- testButton = coreControlsAdd("Test Button");
|
|
|
- coreControlsBindKey(testButton, GLFW_KEY_T);
|
|
|
-
|
|
|
- showWindow();
|
|
|
- setWindowRunHandler(isRunning, nullptr);
|
|
|
- setWindowTickHandler(tick, nullptr);
|
|
|
- setWindowRenderHandler(render, nullptr);
|
|
|
- setWindowNanosPerTick(50000000);
|
|
|
- runWindow();
|
|
|
- closeWindow();
|
|
|
-}
|
|
|
|
|
|
int main(int argAmount, char** args) {
|
|
|
(void)args;
|
|
|
if(argAmount < 3) {
|
|
|
- CORE_LOG_ERROR("missing path to images and/or mode");
|
|
|
+ LOG_ERROR("missing path to images and/or mode");
|
|
|
return 0;
|
|
|
} else if(strcmp("test", args[2]) == 0) {
|
|
|
testImageReader(args[1]);
|
|
@@ -67,6 +17,6 @@ int main(int argAmount, char** args) {
|
|
|
testWindow();
|
|
|
}
|
|
|
finalizeTests();
|
|
|
- corePrintMemoryReport();
|
|
|
+ printMemoryReport();
|
|
|
return 0;
|
|
|
}
|