imxc 0.5.0 → 0.5.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/init.js +13 -1
- package/package.json +1 -1
package/dist/init.js
CHANGED
|
@@ -1,5 +1,10 @@
|
|
|
1
1
|
import * as fs from 'node:fs';
|
|
2
2
|
import * as path from 'node:path';
|
|
3
|
+
const GITIGNORE = `build/
|
|
4
|
+
node_modules/
|
|
5
|
+
*.ini
|
|
6
|
+
.cache/
|
|
7
|
+
`;
|
|
3
8
|
const APPSTATE_H = `#pragma once
|
|
4
9
|
#include <functional>
|
|
5
10
|
|
|
@@ -100,8 +105,13 @@ int main() {
|
|
|
100
105
|
app.state.onIncrement = [&]() { app.state.count++; };
|
|
101
106
|
|
|
102
107
|
while (glfwWindowShouldClose(window) == 0) {
|
|
103
|
-
|
|
108
|
+
if (app.runtime.needs_frame()) {
|
|
109
|
+
glfwPollEvents();
|
|
110
|
+
} else {
|
|
111
|
+
glfwWaitEventsTimeout(0.1);
|
|
112
|
+
}
|
|
104
113
|
render_frame(app);
|
|
114
|
+
app.runtime.frame_rendered(ImGui::IsAnyItemActive());
|
|
105
115
|
}
|
|
106
116
|
|
|
107
117
|
ImGui_ImplOpenGL3_Shutdown();
|
|
@@ -485,6 +495,7 @@ export function initProject(projectDir, projectName) {
|
|
|
485
495
|
fs.writeFileSync(path.join(srcDir, 'imx.d.ts'), IMX_DTS);
|
|
486
496
|
fs.writeFileSync(path.join(projectDir, 'tsconfig.json'), TSCONFIG);
|
|
487
497
|
fs.writeFileSync(path.join(projectDir, 'CMakeLists.txt'), cmakeTemplate(name, 'https://github.com/bgocumlu/imx.git'));
|
|
498
|
+
fs.writeFileSync(path.join(projectDir, '.gitignore'), GITIGNORE);
|
|
488
499
|
console.log(`imxc: initialized project "${name}"`);
|
|
489
500
|
console.log('');
|
|
490
501
|
console.log(' Created:');
|
|
@@ -494,6 +505,7 @@ export function initProject(projectDir, projectName) {
|
|
|
494
505
|
console.log(` src/imx.d.ts — type definitions for IDE support`);
|
|
495
506
|
console.log(` tsconfig.json — TypeScript config`);
|
|
496
507
|
console.log(` CMakeLists.txt — build config with FetchContent`);
|
|
508
|
+
console.log(` .gitignore — ignores build/, node_modules/, *.ini`);
|
|
497
509
|
console.log(` public/ — static assets (copied to exe directory)`);
|
|
498
510
|
console.log('');
|
|
499
511
|
console.log(' Next steps:');
|