Interested in bug reports yet?

1
for(;;)


currently causes a seg-fault.

P.S. really enjoying it all so far!

Edited by Andy Gill on Reason: Initial post
Of course! Also feel free to file them as a GitHub issue.

I just pushed the fix for that bug. Thanks!
Does using strcpy_s is a) C11, not C99 b) not available in linux's gcc and

SDL_SetWindowResizable which doesn't exist yet in ubuntu 16.04LTS because its SDL too old counts as bug?
We're already using a smattering of C11 features (anonymous structs/unions and x[] arrays), so I thought using the safe string functions would be sufficiently portable. If GCC doesn't support them, I can get rid of them. Usually my constraint on modern C features is what MSVC will support since it usually lags by many years.

What version of SDL is in Ubuntu? I'm just getting started with Noir, so it's highly likely I'll end up using other API functions that might not be available. If it's not too ancient, I'll see if I can avoid using the newer functions.

Edited by Per Vognsen on
pervognsen


What version of SDL is in Ubuntu? I'm just getting started with Noir, so it's highly likely I'll end up using other API functions that might not be available...


$ sudo apt install libsdl2-dev
libsdl2-dev is already the newest version (2.0.4+dfsg1-2ubuntu2).

SDL_SetWindowResizable is available since SDL 2.0.5. Prior versions seems need to use SDL_WINDOW_RESIZABLE flag instead.
Hrm. 2.0.4 is well over 2 years old and SDL has since had numerous bug fixes in addition to the couple of new features. Limiting resizability changes to window creation time isn't a huge burden but let me audit the other changes that were made since 2.0.4 to see if we'll be missing out on anything major. Thanks for the info.

Edited by Per Vognsen on
BTW,
1
2
3
4
5
6
  static bool init_window(void) {...
      extern void update_window();
      update_window();
}

static void update_window(void) {


Does it work in MSVC? Gcc and clang don't like that update_window is redefined from extern to static. They also not fans of
1
2
case SDL_KEYUP:
int key = sdl_scancode_to_noir_key[event.key.keysym.scancode]; 

due the fact int key=... is a decl, not a statement or an expression

Edited by Maykeye on
Both should be fixed in latest. I'm also going to start thinking about more serious build scaffolding for cross platform and third party libraries, which will be a work in progress.
Heads up: I added an explicit check for C11 or Visual Studio 2015 or later. Someone somehow managed to build Ion with VS 2013 I have no idea how the compound literals and designated initializers were accepted) but it generated garbage because it has enough C99 features to compile but its snprintf is busted, so I want to prevent that kind of confusion in the future.

The upshot for GCC and Clang users is that you'll need to build with -std=c11. We still only use a few C11 features, though, only anonymous structs/unions.

Edited by Per Vognsen on
pervognsen
Hrm. 2.0.4 is well over 2 years old and SDL has since had numerous bug fixes in addition to the couple of new features. Limiting resizability changes to window creation time isn't a huge burden but let me audit the other changes that were made since 2.0.4 to see if we'll be missing out on anything major. Thanks for the info.


New Ubuntu LTS(18.04) should come out this week probably shipped with SDL2 version 2.0.8 on the board, and since it's LTS, supporting older LTSes may not be that necessary anymore.

Debian stable has 2.0.5 though. Enough for resizing window, but not for vulkan goodies.
Cool, that's good to know.

Heads up: There's been a major overhaul to the compiler to deal with packages. The workflow is infinitely more streamlined now, but you need to change a few things if you want your old code to still work. Set IONHOME to the ion directory that contains system_packages. The ion search paths default to $IONHOME/system_packages and the current working directory, followed by anything in the semicolon-separated IONPATH. Put all the .ion files for a single package in its own directory. You can see how the test1, test2, subtest1 and noir packages are laid out in the repo. The compiler itself also prints way more diagnosis messages so you can see what's going on. This will eventually be off by default unless you use a command line flag, but for now I'm leaving it on to help with bugs.

Edited by Per Vognsen on