Comments (4)
from cosmic.
[tommhnsn@thomas-galagopro cosmic-master]$ zig build run -Dpath="graphics/examples/demo.zig" -Dgraphics -Drelease-safe
/home/tommhnsn/Downloads/cosmic-master/graphics/examples/demo.zig:15:16: error: variable of type 'graphics.examples.helper.App' must be const or comptime
var app: helper.App = undefined;
~~~~~~^~~~
/home/tommhnsn/Downloads/cosmic-master/graphics/examples/helper.zig:12:11: note: struct requires comptime because of this field
gctx: *graphics.Graphics,
^~~~~~~~~~~~~~~~~~
/home/tommhnsn/Downloads/cosmic-master/graphics/src/graphics.zig:90:11: note: struct requires comptime because of this field
impl: switch (Backend) {
^~~~~~
/home/tommhnsn/Downloads/cosmic-master/graphics/src/backend/gpu/graphics.zig:96:14: note: struct requires comptime because of this field
batcher: Batcher,
^~~~~~~
/home/tommhnsn/Downloads/cosmic-master/graphics/src/backend/gpu/batcher.zig:66:35: note: struct requires comptime because of this field
pre_flush_tasks: std.ArrayList(PreFlushTask),
~~~~~~~~~~~~~^~~~~~~~~~~~~~
/usr/lib/zig/lib/std/array_list.zig:41:16: note: struct requires comptime because of this field (12 times)
items: Slice,
^~~~~
/home/tommhnsn/Downloads/cosmic-master/graphics/src/backend/gpu/batcher.zig:52:9: note: struct requires comptime because of this field
cb: fn (ctx: ?*anyopaque) void,
^~~~~~~~~~~~~~~~~~~~~~~~~~
/home/tommhnsn/Downloads/cosmic-master/graphics/src/backend/gpu/batcher.zig:52:9: note: use '*const fn(?*anyopaque) void' for a function pointer type
cb: fn (ctx: ?*anyopaque) void,
^~~~~~~~~~~~~~~~~~~~~~~~~~
/home/tommhnsn/Downloads/cosmic-master/graphics/src/backend/gpu/graphics.zig:97:17: note: struct requires comptime because of this field
font_cache: FontCache,
^~~~~~~~~
/home/tommhnsn/Downloads/cosmic-master/graphics/src/backend/gpu/font_cache.zig:46:25: note: struct requires comptime because of this field
fonts: std.ArrayList(Font),
~~~~~~~~~~~~~^~~~~~
/home/tommhnsn/Downloads/cosmic-master/graphics/src/font.zig:50:14: note: struct requires comptime because of this field
ot_font: OpenTypeFont,
^~~~~~~~~~~~
/home/tommhnsn/Downloads/cosmic-master/graphics/src/ttf.zig:147:19: note: struct requires comptime because of this field
glyph_mapper: GlyphMapperIface,
^~~~~~~~~~~~~~~~
/home/tommhnsn/Downloads/cosmic-master/graphics/src/ttf.zig:94:22: note: struct requires comptime because of this field
get_glyph_id_fn: fn (*anyopaque, cp: u21) FontError!?u16,
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/home/tommhnsn/Downloads/cosmic-master/graphics/src/ttf.zig:94:22: note: use '*const fn(*anyopaque, u21) error{InvalidFont,Unsupported}!?u16' for a function pointer type
get_glyph_id_fn: fn (*anyopaque, cp: u21) FontError!?u16,
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/home/tommhnsn/Downloads/cosmic-master/graphics/src/font.zig:55:21: note: struct requires comptime because of this field
bmfont_strikes: []const BitmapFontStrike,
^~~~~~~~~~~~~~~~~~~~~~~~
/home/tommhnsn/Downloads/cosmic-master/graphics/src/font.zig:235:14: note: struct requires comptime because of this field
ot_font: OpenTypeFont,
^~~~~~~~~~~~
/home/tommhnsn/Downloads/cosmic-master/graphics/src/backend/gpu/font_cache.zig:60:17: note: struct requires comptime because of this field
main_atlas: FontAtlas,
^~~~~~~~~
/home/tommhnsn/Downloads/cosmic-master/graphics/src/backend/gpu/font_atlas.zig:13:8: note: struct requires comptime because of this field
g: *gpu.Graphics,
^~~~~~~~~~~~~
/home/tommhnsn/Downloads/cosmic-master/graphics/src/backend/gpu/font_atlas.zig:16:13: note: struct requires comptime because of this field
packer: RectBinPacker,
^~~~~~~~~~~~~
/home/tommhnsn/Downloads/cosmic-master/graphics/src/rect_bin_packer.zig:27:30: note: struct requires comptime because of this field
resize_cbs: std.ArrayList(ResizeCallbackItem),
~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~
/home/tommhnsn/Downloads/cosmic-master/graphics/src/rect_bin_packer.zig:12:9: note: struct requires comptime because of this field
cb: ResizeCallback,
^~~~~~~~~~~~~~
/home/tommhnsn/Downloads/cosmic-master/graphics/src/rect_bin_packer.zig:12:9: note: use '*const fn(?*anyopaque, u32, u32) void' for a function pointer type
cb: ResizeCallback,
^~~~~~~~~~~~~~
/home/tommhnsn/Downloads/cosmic-master/graphics/src/backend/gpu/font_cache.zig:63:19: note: struct requires comptime because of this field
bitmap_atlas: FontAtlas,
^~~~~~~~~
/home/tommhnsn/Downloads/cosmic-master/graphics/src/graphics.zig:97:15: note: struct requires comptime because of this field
new_impl: switch (Backend) {
^~~~~~
/home/tommhnsn/Downloads/cosmic-master/graphics/src/backend/gl/graphics.zig:20:14: note: struct requires comptime because of this field
gpu_ctx: *gpu.Graphics,
^~~~~~~~~~~~~
/home/tommhnsn/Downloads/cosmic-master/graphics/examples/helper.zig:13:23: note: struct requires comptime because of this field
renderer: graphics.WindowRenderer,
~~~~~~~~^~~~~~~~~~~~~~~
/home/tommhnsn/Downloads/cosmic-master/graphics/src/renderer.zig:67:24: note: struct requires comptime because of this field
swapchain: graphics.SwapChain,
~~~~~~~~^~~~~~~~~~
/home/tommhnsn/Downloads/cosmic-master/graphics/src/swapchain.zig:11:11: note: struct requires comptime because of this field
impl: switch (Backend) {
^~~~~~
/home/tommhnsn/Downloads/cosmic-master/graphics/src/backend/gl/swapchain.zig:8:10: note: struct requires comptime because of this field
win: *platform.Window,
^~~~~~~~~~~~~~~~
/home/tommhnsn/Downloads/cosmic-master/platform/window.zig:25:16: note: struct requires comptime because of this field
on_resize: ?fn (ctx: ?*anyopaque, width: u32, height: u32) void,
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/home/tommhnsn/Downloads/cosmic-master/platform/window.zig:25:16: note: use '*const fn(?*anyopaque, u32, u32) void' for a function pointer type
on_resize: ?fn (ctx: ?*anyopaque, width: u32, height: u32) void,
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/home/tommhnsn/Downloads/cosmic-master/graphics/src/renderer.zig:68:15: note: struct requires comptime because of this field
renderer: Renderer,
^~~~~~~~
/home/tommhnsn/Downloads/cosmic-master/graphics/src/renderer.zig:15:19: note: struct requires comptime because of this field
gctx: graphics.Graphics,
~~~~~~~~^~~~~~~~~
/home/tommhnsn/Downloads/cosmic-master/graphics/src/renderer.zig:69:10: note: struct requires comptime because of this field
win: *platform.Window,
^~~~~~~~~~~~~~~~
/home/tommhnsn/Downloads/cosmic-master/graphics/examples/helper.zig:15:17: note: struct requires comptime because of this field
dispatcher: EventDispatcher,
^~~~~~~~~~~~~~~
/home/tommhnsn/Downloads/cosmic-master/platform/event_dispatcher.zig:23:28: note: struct requires comptime because of this field
quit_cbs: std.ArrayList(HandlerEntry(OnQuitHandler)),
~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/home/tommhnsn/Downloads/cosmic-master/platform/event_dispatcher.zig:387:13: note: struct requires comptime because of this field (9 times)
cb: Handler,
^~~~~~~
/home/tommhnsn/Downloads/cosmic-master/platform/event_dispatcher.zig:387:13: note: use '*const fn(?*anyopaque) void' for a function pointer type
cb: Handler,
^~~~~~~
/home/tommhnsn/Downloads/cosmic-master/platform/event_dispatcher.zig:24:31: note: struct requires comptime because of this field
keydown_cbs: std.ArrayList(HandlerEntry(OnKeyDownHandler)),
~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/home/tommhnsn/Downloads/cosmic-master/platform/event_dispatcher.zig:387:13: note: use '*const fn(?*anyopaque, keyboard.KeyDownEvent) void' for a function pointer type
cb: Handler,
^~~~~~~
/home/tommhnsn/Downloads/cosmic-master/platform/event_dispatcher.zig:25:29: note: struct requires comptime because of this field
keyup_cbs: std.ArrayList(HandlerEntry(OnKeyUpHandler)),
~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/home/tommhnsn/Downloads/cosmic-master/platform/event_dispatcher.zig:387:13: note: use '*const fn(?*anyopaque, keyboard.KeyUpEvent) void' for a function pointer type
cb: Handler,
^~~~~~~
/home/tommhnsn/Downloads/cosmic-master/platform/event_dispatcher.zig:26:33: note: struct requires comptime because of this field
mousedown_cbs: std.ArrayList(HandlerEntry(OnMouseDownHandler)),
~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/home/tommhnsn/Downloads/cosmic-master/platform/event_dispatcher.zig:387:13: note: use '*const fn(?*anyopaque, mouse.MouseDownEvent) event_dispatcher.EventResult' for a function pointer type
cb: Handler,
^~~~~~~
/home/tommhnsn/Downloads/cosmic-master/platform/event_dispatcher.zig:27:31: note: struct requires comptime because of this field
mouseup_cbs: std.ArrayList(HandlerEntry(OnMouseUpHandler)),
~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/home/tommhnsn/Downloads/cosmic-master/platform/event_dispatcher.zig:387:13: note: use '*const fn(?*anyopaque, mouse.MouseUpEvent) void' for a function pointer type
cb: Handler,
^~~~~~~
/home/tommhnsn/Downloads/cosmic-master/platform/event_dispatcher.zig:28:33: note: struct requires comptime because of this field
mousemove_cbs: std.ArrayList(HandlerEntry(OnMouseMoveHandler)),
~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/home/tommhnsn/Downloads/cosmic-master/platform/event_dispatcher.zig:387:13: note: use '*const fn(?*anyopaque, mouse.MouseMoveEvent) void' for a function pointer type
cb: Handler,
^~~~~~~
/home/tommhnsn/Downloads/cosmic-master/platform/event_dispatcher.zig:29:35: note: struct requires comptime because of this field
mousescroll_cbs: std.ArrayList(HandlerEntry(OnMouseScrollHandler)),
~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/home/tommhnsn/Downloads/cosmic-master/platform/event_dispatcher.zig:387:13: note: use '*const fn(?*anyopaque, mouse.MouseScrollEvent) void' for a function pointer type
cb: Handler,
^~~~~~~
/home/tommhnsn/Downloads/cosmic-master/platform/event_dispatcher.zig:30:33: note: struct requires comptime because of this field
winresize_cbs: std.ArrayList(HandlerEntry(OnWindowResizeHandler)),
~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/home/tommhnsn/Downloads/cosmic-master/platform/event_dispatcher.zig:387:13: note: use '*const fn(?*anyopaque, platform.WindowResizeEvent) void' for a function pointer type
cb: Handler,
^~~~~~~
/home/tommhnsn/Downloads/cosmic-master/platform/event_dispatcher.zig:31:35: note: struct requires comptime because of this field
fetchresult_cbs: std.ArrayList(HandlerEntry(OnFetchResultHandler)),
~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/home/tommhnsn/Downloads/cosmic-master/platform/event_dispatcher.zig:387:13: note: use '*const fn(?*anyopaque, platform.FetchResultEvent) void' for a function pointer type
cb: Handler,
^~~~~~~
/home/tommhnsn/Downloads/cosmic-master/graphics/examples/helper.zig:16:10: note: struct requires comptime because of this field
win: Window,
^~~~~~
error: demo...
error: The following command exited with error code 1:
After changing matrix and transform libraries over like this
const Mat4 = stdx.math.matrix.Mat4;
const Mat3 = stdx.math.matrix.Mat3;
and replacing all of them in the project like that, I run into this error which I find more difficult to find. I will see if I can upload my branch so you can see the progress.
from cosmic.
https://github.com/thomas992/cosmicfix
there were many files changed and still not working yet. I think there is a way to include matrix and transform without renaming the rest of the files but you would still get the same error telling you to put app variable into comptime
from cosmic.
Function pointers have to be wrapped in std.meta.FnPtr in stage3. I will commit what I have atm, it gets past the compiler errors for demo.zig on linux but there's a segfault during build-exe so I'm punting this for now unless someone has some insight.
For the time being you could use -fstage1.
from cosmic.
Related Issues (20)
- UI Framework HOT 1
- Native async File IO
- Sync and Native async network IO
- JS Web Target
- WASM Web Target
- Crash on zig build get-deps HOT 3
- Example build error HOT 3
- Text_demo 'Load Font' crash HOT 1
- Text_demo 'Text Wrap' doesn't seem to work HOT 1
- Text_demo: clicking on scroll bar
- Text_demo: double click to open directory
- Support Vulkan on Windows
- Easier development with Vulkan on macOS
- build error: redeclaration of succcess_cb HOT 2
- import std null build error gitrepostep HOT 6
- Text To Speech, Speech To Text HOT 1
- Build on Windows fails due to missing SDL2 files HOT 3
- Build error HOT 1
- Build error. Multiple errors "local variable is never mutated" and other errors HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from cosmic.