We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
I have a sdl app that runs on both, but if I try to log something (or println), it freezes on tcc.
module no_main import sdl import sdl.callbacks import log struct AppState { mut: a_pressed bool } struct SDLApp { window_height int = 640 window_width int = 480 mut: window &sdl.Window = unsafe { nil } renderer &sdl.Renderer = unsafe { nil } state AppState = AppState{} } fn init() { unbuffer_stdout() callbacks.on_init(app_init) callbacks.on_event(app_event) callbacks.on_iterate(app_iterate) callbacks.on_quit(app_quit) } @[export: 'v_sdl_app_init'] pub fn app_init(app_ptr &voidptr, _ int, _ &&char) sdl.AppResult { mut app := &SDLApp{} unsafe { *app_ptr = app } sdl.set_app_metadata(c'Snippy', c'0.01', c'de.xyndra.snippy') if !sdl.init(sdl.init_video) { error_msg := unsafe { cstring_to_vstring(sdl.get_error()) } eprintln("Couldn't initialize SDL: ${error_msg}") return .failure } if !sdl.create_window_and_renderer(c'Snippy', app.window_width, app.window_width, sdl.WindowFlags(0), &app.window, &app.renderer) { error_msg := unsafe { cstring_to_vstring(sdl.get_error()) } eprintln("Couldn't create window/renderer: ${error_msg}") return .failure } return .continue // carry on with the program! } @[export: 'v_sdl_app_event'] pub fn app_event(app_ptr voidptr, event &sdl.Event) sdl.AppResult { mut app := unsafe { &SDLApp(app_ptr) } match event.type { .quit { return .success // end the program, reporting success to the OS. } .key_down { keyboard_event := unsafe { &sdl.KeyboardEvent(event) } match unsafe { sdl.KeyCode(keyboard_event.key) } { .a { app.state.a_pressed = !app.state.a_pressed } else {} } } else {} } return .continue // carry on with the program! } @[export: 'v_sdl_app_iterate'] pub fn app_iterate(app_ptr voidptr) sdl.AppResult { return .continue // carry on with the program! } @[export: 'v_sdl_app_quit'] pub fn app_quit(app_ptr voidptr, _ sdl.AppResult) { mut app := unsafe { &SDLApp(app_ptr) } log.info("A was " + if app.state.a_pressed { "" } else { "not " } + "pressed.") }
v -cc msvc run .
v -cc tcc run .
Both don't freeze
TCC freezes during exiting and has to be terminated by the windows not responding dialog.
No response
I am using sdl 3.2.0 vlang bindings
V 0.4.9 3c88926
Note
You can use the 👍 reaction to increase the issue's priority for developers.
Please note that only the 👍 reaction to the issue itself counts as a vote. Other reactions and those to comments will not be taken into account.
The text was updated successfully, but these errors were encountered:
Connected to Huly®: V_0.6-22204
Sorry, something went wrong.
No branches or pull requests
Describe the bug
I have a sdl app that runs on both, but if I try to log something (or println), it freezes on tcc.
Reproduction Steps
v -cc msvc run .
v -cc tcc run .
Expected Behavior
Both don't freeze
Current Behavior
TCC freezes during exiting and has to be terminated by the windows not responding dialog.
Possible Solution
No response
Additional Information/Context
I am using sdl 3.2.0 vlang bindings
V version
V 0.4.9 3c88926
Environment details (OS name and version, etc.)
Note
You can use the 👍 reaction to increase the issue's priority for developers.
Please note that only the 👍 reaction to the issue itself counts as a vote.
Other reactions and those to comments will not be taken into account.
The text was updated successfully, but these errors were encountered: