Dears User,
I am new here and not sure whether I am in the right place for this question.
I wanted to port my graphics.h program to the web.Never used emcascripten
to port anything to the web,I created a makefile.Here is the source code.
How can I create a javascript file from this main.cpp using graphics.h ,and ecmascripten.h
in a c or cpp file.
Natively graphics .h works only with .cpp extension.
Here is my makefile
CC=em++
INCLUDE=-I./include
LIB=-L./lib
SRC=./src
LOPTIONS=-lbgi -lgdi32 -lcomdlg32 -luuid -loleaut32 -lole32
TARGET=js/torus.js
serve:
emrun --no_browser --port 8080 .
build:
$(CC) -o $(TARGET) $(SRC)/main.cpp $(INCLUDE) $(LIB) $(LOPTIONS)
clean:
rm -f $(TARGET)
.PHONY: clean
#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;
}```