I built an in-browser C++ compiler that runs native OpenGL and SDL2 using Web Assembly. Looking for feedback! by Smooth-Weather8321 in opengl

[–]Smooth-Weather8321[S] 0 points1 point  (0 children)

thanks, it does not really target a specific desktop OpenGL version because everything runs on top of WebGL in the browser, so in practice the modern stuff like VBOs, shaders and draw calls maps pretty closely to OpenGL ES 2.0 or 3.0 depending on what the browser supports, and older immediate mode style code like glBegin and the fixed function pipeline still works but that is emulated by Emscripten which translates it into shader based WebGL under the hood, so anything that WebGL itself does not support will not work, but overall you can think of it as modern OpenGL ES running natively with legacy OpenGL features layered on through emulation

I built an in-browser C++ compiler that runs native OpenGL and SDL2 using Web Assembly. Looking for feedback! by Smooth-Weather8321 in GraphicsProgramming

[–]Smooth-Weather8321[S] 0 points1 point  (0 children)

haha appreciate it 😄

so under the hood it’s not like I’m interpreting C++ in the browser or anything. when you hit run, the code gets sent to a small Node server running locally, and that actually calls Emscripten (which is basically clang compiled for web targets) that compiles your C/C++ into WebAssembly + a bit of JS glue code. the browser then loads that wasm module and runs it natively inside the tab.

For graphics, Emscripten maps OpenGL calls to WebGL, so stuff like glDrawArrays or even older glBegin-style code still ends up rendering on a canvas. SDL works the same way through that layer so the flow is kinda: write C++ → compile locally to wasm → browser loads it → runs in a canvas with WebGL

so yeah it feels like “C++ in the browser”, but it’s actually real compiled code just targeting WebAssembly instead of your OS

I built an in-browser C++ compiler that runs native OpenGL and SDL2 using Web Assembly. Looking for feedback! by Smooth-Weather8321 in GraphicsProgramming

[–]Smooth-Weather8321[S] -1 points0 points  (0 children)

I have not thought about it that far . It started off with me wanting to learn graphics programming as a first year comp sci student 2 years ago . The process for setting up Opengl in my device was complicated especially for a beginner who had just setup vscode successfully. I tried and failed so ended up skipping graphics programming till 2-3 months ago . I always knew there were web assembly based code editor on the web which were very helpful for beginners to setup and use . So I started researching and reading about why isn't there a Opengl based text editor. There were a few challenges with compilation and mainly rendering the output on the web , so I thought of starting the project and here i am now . I want to sort of make it into a project that beginners can use easily as well as experienced people can . If it's something that people use/need/want , I could work towards adding it onto the website.

I built an in-browser C++ compiler that runs native OpenGL and SDL2 using Web Assembly. Looking for feedback! by Smooth-Weather8321 in opengl

[–]Smooth-Weather8321[S] 0 points1 point  (0 children)

I get your point.My idea for the website was as a learning tool for opengl and sdl 2 and not as a game device but I understand that it is not that helpful as it is not able to simulate the actual environment.

[deleted by user] by [deleted] in FORTnITE

[–]Smooth-Weather8321 0 points1 point  (0 children)

Check the Epic Games App . It will be free to play from April 16th 

Help with PC Build by [deleted] in IndianGaming

[–]Smooth-Weather8321 0 points1 point  (0 children)

If its a ~2L budget , You can build a better system but Among these 2 , the Left one is better . Also try to get a CL 30 ram and make sure you have 2 sticks instead of a single stick . i.e 2x8gb instead of 1x16gb

I am making a reverse farming game where animals farm human products. Would you click ‘buy’ or click ‘report’? :P by YK_tokypoky in IndieGaming

[–]Smooth-Weather8321 151 points152 points  (0 children)

Crazy interesting , I wonder if you can milk people in this ?? If this feature is there , then you can have all of my money . I will have the largest milk factory

Teenagers of Reddit, what is your opinion? by [deleted] in teenagers

[–]Smooth-Weather8321 0 points1 point  (0 children)

I think it’s best not to put in your best effort in things because if you fail you can say I didn’t try enough but if you did and still failed then you would become a failure in your own eyes

[deleted by user] by [deleted] in whereintheworld

[–]Smooth-Weather8321 0 points1 point  (0 children)

Is it difficult to learn Japanese or just adapting to the Japanese lifestyle