|
Programming C, bash, Python, Perl, PHP, Java, you name it. |
|
Thread Tools | Display Modes |
|
|||
SDL2 not working in netbsd - "no available video device"
since my sdl2 programs run slow in openbsd, and blazing fast in slackware, i decided to try them on netbsd 7.1
Code:
#include <stdio.h> #include <stdlib.h> #include <SDL.h> void die (char *msg) { fprintf (stderr, "err: %s\n", msg); exit (0x0f); } int main (int ac, char **av) { if (SDL_Init (SDL_INIT_VIDEO)) die (SDL_GetError ()); puts ("SDL init -> OK"); return 0; } Code:
gcc testing.c -o testing `sdl2-config --libs --cflags` Code:
err: No available video device |
|
|||
Found an "answer" elsewhere that might help you: Before you run the program, type "export DISPLAY=:0" or whichever display you'd like to target.
Before I tried that, I was receiving your same error. After I did that, the program appeared as a new window in my X11 session. For me, the "answer" doesn't help. I'm trying to run everything without X and had started experimenting with "SDL games" because I (mistakenly?) thought SDL made it possible to display graphics within a console virtual terminal. |
|
|||
@talos4 well on linux you can with sdl1 so you weren't totally mistaken.
|
|
|||
Thanks, frakswe and head_on_a_stick.
But, when I didn't specify a DISPLAY and then launched several different SDL-dependent games in ports (dhewm3, freeorion), I received the same errors as billy_bazooka. (Any relation to "Bazooka, Joe"? I wonder...) I ran those games really just to test, hoping to see something in the distribution render graphics to the console. But, what I really would like to do is run: http://uobikiemukot.github.io/yaft/ which claims to support 256 colors in the terminal. Yaft doc says to set: FRAMEBUFFER="/dev/fb1" # seems specific to linux before running "yaft". But, I don't know the "/dev/fb1" equivalent on OpenBSD. Would it be "/dev/dri/card0" or card1? If I launch "yaft" w/o setting the FRAMEBUFFER envar or if I set it to "/dev/dri/card0", I get: "WSDISPLAYIO_SETGFXMODE failed" Unless anyone points out something obvious I'm overlooking, guess I should ping the "yaft" author for possible help. |
|
|||
Thanks, Head.
|
|
|||
https://gitlab.com/osen/openbsd_drmfb_gnuboy
don't know your level of programming expertise but this emulator uses the framebuffer and openbsd, might learn something from the code how to go about it. maybe try putting a single pixel on the screen then go from there. |
|
|||
@ frakswe
Thanks! That's interesting. I've hardly written any C and never worked on this level of the stack. (I'm an old rdbms guy.) But, I've bookmarked that and hopefully someday will look into it, as I'd like my console emacs to use 256 colors for syntax highlighting and maybe even displaying images inline. Last edited by talos4; 19th September 2022 at 01:30 PM. |
|
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
Difference between"arp info overwritten" and " duplicate IP address " | varag | OpenBSD Security | 1 | 6th April 2015 02:57 PM |
Fresh installation 6.1.2 amd64 freezes in the line "root device" | divel | NetBSD Installation and Upgrading | 2 | 22nd November 2013 07:11 PM |
"no root device found" while installing | kondziq | FreeBSD Installation and Upgrading | 4 | 29th November 2011 10:01 AM |
System stops booting after "GEOM_MIRROR: Force device gm0 start due to timeout." | indienick | FreeBSD General | 1 | 25th March 2010 09:46 PM |
Fixed "xinit" after _7 _8, "how" here in case anyones' "X" breaks... using "nvidia" | jb_daefo | Guides | 0 | 5th October 2009 09:31 PM |