r/GraphicsProgramming • u/5H_RIZVI • 24d ago
Question Is there an online C++ OpenGL compiler that shows graphics output?
Hi everyone!
I'm a beginner learning C++, OpenGL, and GLUT for my university course.
Setting everything up on Windows takes a lot of time, especially when switching PCs.
Is there any online compiler where I can write C++ OpenGL/GLUT code, run it, and see the graphics output directly in my browser?
I'd appreciate any suggestions. Thanks!
11
Upvotes
4
u/arthurno1 23d ago
No, it does not, it takes literally like 5 minutes max.
Install msys2. Once you have run the installer, upen ucrt64 console and run:
That will install all you need.
You write your code in a text editor of your choice and type
Than you can typically bring you through the entire course. You can automate with a shell script or a makefile in like 5 - 10 lines.
Test:
Run:
GLUT is fine for learning in a course, it is what it was basically invented for. Good decision by your teacher.
Something tells me you want, but there it is.
13
u/Syracuss 24d ago
Set up a git project, have it fetch the dependencies in a cmake script (or whatever build system you prefer, cmake is just very common), and push it to github or some other place where you can store your project accessibly.
Everything else is a workaround to an environment problem you will need to learn to navigate anyway. If you're unwilling to learn this step right now prompt an LLM to do it for you, or preferentially ask a teacher at your uni, I'm fairly certain they are willing to guide you.
At work I jump between OS's and machines within the day depending on tasks, it's something you'll have to learn eventually and the suggestions here so far are trying to solve your problem with new processes that aren't useful long term.
3
u/Otherwise_Meat1161 23d ago
make a template and use that, all you need is a CMAKE, submodule GLFW/SDL and your very own GLAD.h with the extensions you need, make a main.cpp and upload it to your github.
btw its not that difficult to setup compared to lets say vulkan where you will just be spending a day or two just getting the device and queues and buffers etc.
5
u/Bellaedris 24d ago
...... WebGL?
1
u/VagueHorizon_ 23d ago
Which semester course is this ?
2
u/_Wolfos 24d ago
I doubt it. You can probably write a Powershell script that sets up the environment automatically though.
2
u/pjmlp 23d ago
Making a configuration with CMake and vcpkg , would make it relatively easy.
Here a random example,
https://github.com/jukehtinen/opengl-starter
2
u/VictoryMotel 23d ago
If you are learning opengl and c++ at the same time you will need to compile a program that runs opengl stuff eventually. Lots of people use glfw if you have a choice.
If you want to learn and experiment with opengl faster in a more forgiving way, it will be a lot easier to use webgl for trial and error then take that experience and use it with C++.
2
u/[deleted] 24d ago
Check a tool called "apitrace". It is a protocol analyzer that spies the connection between your running program and your GPU by intercepting library calls to OpenGL DLL.
You can capture a session and then reproduce the log frame by frame and call by call, like a debugger.
1
u/corysama 23d ago
So, you are moving around between shared Windows PCs at school. What is expected to be pre-installed on those PCs? Surely you are not expected to learn programming by downloading and installing a compiler every time you sit down at a computer?
-7
u/EC36339 23d ago
Claude Code can compile your C++ code and run it directly in the Linux container your session runs in. But it will only be able to use software rendering and show you screenshots of it.
Setting everything up on Windows is something an AI agent can either do for you or walk you through. I recommend the second alternative so you learn something. Then have it all written down in a text file, so in case you have to do it again, you can automate it the next time.
Ignore the haters who might tell you, you won't learn anything without pain and effort. Pain doesn't help you learn, it only slows you down and exhausts you.
-8
u/Major_Chocolate2441 24d ago
There's Emabarcadero which you can keep on a stick. I set it up with 7z rather than double clicking the installer though. Download Claude and say you need a drag and drop Settings file for Embarcadero on your stick. And you intend to keep libraries (OpenGL, GLUT, etc.) in a Libs folder under Embarcadero and you'll keep your projects there also under a Projects folder.