18 questions
Score of 0
1 answer
63 views
Problems with fragmentshader while creating several windows with egl on wayland
I use my own bindings to libwayland in Odin and I'm able to open several windows at once. The vertexshader works as expected, but the fragmentshader is not. It seems to only work in the last window I ...
Score of 1
1 answer
133 views
odin(idioma): the preferred way to compare slices
If i would compare by references i can deal with raw_data from
What is the preferred method of comparing values?
I think it's too generic to not exist in std...
// Maybe I can make `return false` on `...
Score of 0
1 answer
67 views
Dynamic array passed to function, first two members are corrupted
I am trying to learn Odin for Advent of Code and have run into a problem reading a file line by line in a function. I have tried returning the array by value and returning a slice. Each results in ...
Score of 1
1 answer
485 views
Unable to render sprites in batches / instances using SDL3 GPU API and Odin. SSBO is not available to shader
I am new to graphics in general, so I am trying to learn from others.
After drawing a triangle, a quad and then a sprite on top, I have been trying to get a batch of them on screen using instancing.
...
Score of 0
1 answer
152 views
How to preallocate memory for a map in odin?
I'm learning odin, and I'm writing a program where the map allocating memory, growing and doing its checks is a considerable part of my program running time, is there a way to have a map where I can ...
Score of 1
1 answer
403 views
Odin union question mark (.?) operator
There are a couple of places in Odin language overview where I came across .? operator for unions
It looks like this:
// - Example 1
v: union{int, f64}
i: int
i = v.? or_else 123
// - Example 2
halve ...
Score of 3
1 answer
263 views
Compare structs in Odin
I have the following code in Odin:
Foo :: struct {
x: int,
y: int,
}
a := Foo{1, 1}
b := Foo{1, 1}
#assert(a == b)
According to official documentation I would expect to be able to compare ...
Score of 0
1 answer
77 views
Atomic Atomic_RW_Mutex deadlocking in Odin an unexpected way
I am having some issues understanding how the Atomic_RW_Mutex is supposed to work in Odin. I have attached a minimal example that helps illustrate the problem.
In the below code I would expect that ...
Score of 1
1 answer
108 views
Odin - Read a GZip file
I'm new to Odin and am having some doubts on how to read a large Gzip file.
I've managed to reach the followng point where I load the to a bytes.Buffer. But assuming the gziped file is a text file I'm ...
Score of 0
1 answer
1798 views
In odin is there a good way to make a variable length array on the stack
what i'm looking for is a c style vla:
int len = 5;
int foo[len] = { 0 };
where len is mutable.
in odin this is invalid: Array count must be a constant integer, got len
len := 4
foo: [len]i32 = {}
...
Score of 0
3 answers
394 views
problems with my button background color and hover and active states [closed]
I'm working on the Odin project as a way to shake off the rust, being an ex bootcamper from 2 years ago. I'm on the project where you have to take the rock paper scissors game you've made previously ...
Score of 0
1 answer
515 views
Spawning a Process in Odin
There isn't a lot of documentation of how to do this in Odin but I did find this github issue which seems to be outdated as using that code doesn't compile.
I tried doing
process_state, stdout, stderr,...
Score of 0
1 answer
480 views
How raylib cleans up resources when CloseWindow() is called?
I want to know whether raylib cleans all the resources on CloseWindow() call. And if it does not cleans up everything then what remains to be cleaned up manually?
More context: The program turns into ...
Score of 5
1 answer
674 views
Odin float conversion in core:encoding/json
When loading values from json, if I parse -10.0 from a json file it doesn't get converted to -10.0 but -9.98..
Is this expected behavior? Is it something to do with floats? When I simply multiply 10 ...
Score of 0
0 answers
63 views
ERROR_INVALID_WINDOW_HANDLE using LVM_GETITEMPOSITION [duplicate]
I'm trying to retrieve the positions of the desktop icons.
I do get the right item count, but for the positions I always get 0, 0.
If I check for the last error I get ERROR_INVALID_WINDOW_HANDLE, ...