I was wondering if there was a way to create a window using nasm. I know that when using wsl-2, it allows the user to actually use linux system calls, so are there any particular system calls or libraries that can create a linux window?
Asked
Active
Viewed 200 times
1 Answers
0
There are, I believe, two questions here:
- How to create a window/graphical element using nasm on Ubuntu
- If this will work on Ubuntu on WSL2
The answer to the first part is, I believe, yes. My assembler days are decades behind me, and I really have no desire to try this personally ;-), but a common library for displaying graphics under Linux at a low-level is SDL. All indications that I can find in my search for "nasm and sdl" indicates that it is possible to do this in nasm.
For the second part, almost certainly "Yes", assuming you have the first part working. I do know that SDL-based code will generate graphical windows under WSL2, but you do have to have Windows 11 in order for GUI support to be built-in to WSL. There are workarounds for Windows 10 using other methods - See here and here.

NotTheDr01ds
- 17,888
-
1Thank you!! I've tried asking the question in 15 different ways to google, trying to find a lib, that could possibly do this. – raven_lee Oct 06 '22 at 21:38
-
@raven_lee Glad I could help, and yes, I can imagine that combination of things can be really tough to find in Google search results. Honestly, it wouldn't surprise me if you are the first person to use nasm/WSL and a graphics library! It's certainly the first time I've seen the question asked with that combination! :-). When you get it working, I'd encourage you to write up your own answer with more details, perhaps on Stack Overflow, but here would be fine as well. – NotTheDr01ds Oct 07 '22 at 00:15