1 year ago
#384114
sonod4
graphics.h on WSL
I want to learn graphics.h
to do some graphics (I know it's outdated and everything). I'm currently working on WSL (Windows Subsystem for Linux) with Ubuntu, and cannot use Linux or create a virtual machine for various reasons.
The problem I'm facing is that after installing correctly (supposedly) graphics.h
on my WSL using the instructions here, when I try to execute sample code, it compiles without errors or warnings.
However, when I execute it, it quickly shows these characters:
... before going black until it ends and closes itself regularly. The problem is that it should create a new window with the animation, but it just writes these characters and goes black for a few seconds, without giving any sort of error.
I realize it could be that since I'm working on WSL, the terminal can't open a new window. Is that the case, or what is the problem? How can I make it show the new window? For reference this is the code I'm running:
#include<stdio.h>
#include<stdlib.h>
#include<graphics.h>
int main()
{
int gd = DETECT, gm;
initgraph(&gd, &gm, NULL);
circle(50, 50, 30);
delay(500000);
closegraph();
return 0;
}
c++
windows-subsystem-for-linux
bgi
0 Answers
Your Answer