OpenGL not working

Hello there. I need some help with OpenGL C. When I run my code, nothing displays as it says “There was an error connecting to the server.” with a diagnosis button. Can anyone explain why this is happening and help me?

Could you provide a link to the Repl where you’re experiencing this issue? It would help the community figure out what’s wrong. :smile:

Yeah sure! Here is the link:

Also even though I made a new repl, I feel like opengl still doesn’t work. Heres the link: (I was testing someones code I found on stackblitz)

1 Like

Have you checked it yet?

I had a look, I don’t know Open GL well by any means, but from what I see nothing’s wrong. (Although I do notice you are using C, not C++, but still there’s nothing wrong as far as I can tell).

The issue might simply be a lack of a graphics card and no integrated graphics with the CPU, in which case it makes sense it wouldn’t run.

Replit used to have the option to spend 350 cycles a day (from memory, could be wrong) on a GPU powerup that gave you a GPU with the machine your Repl was in. I don’t know that that still exists though given I can’t see any such option in the Replit workspace. You might have to run this on another machine with either a GPU or integrated graphics on the CPU.

I guess I will try my phone maybe. I will let you know if it works

It won’t be any different on any version of Replit; bear in mind the code isn’t running on your device, it’s stored on and running on Replit’s machines.

Ok yeah I tested it and it didn’t work. But my question is that how can pygame work but OpenGL doesnt?

1 Like

That’s a good question, and I swear Open GL programs used to run on Replit.

It’s possible a recent change to Replit has unintentionally caused this issue.

That said, Pygame is very popular and has been set up by the Replit team so it’s possible that they had to configure it somehow to allow it to work. :man_shrugging:

Alright. Thanks for the help!

1 Like

You never know though, someone else may be able to help fix this, it could be some kind of configuration issue. I don’t use compiled languages on Replit enough to say for sure.

I have made another one but it still doesn’t work. Here’s the link:

I still don’t get why it isn’t working. I looked at the makefile but idk how to read makefiles.

Hey, I took a look at this and noticed that you used my OpenGL and C boilerplate code which I was pleasantly surprised about! I’m very confident that it works, so the reason that it works is most likely some kind of issue on Replit’s end, which sadly would be quite difficult to figure out or find some workaround.

However, I’d also like to say that developing applications using OpenGL on Replit would be a nightmare on it’s own, since you have limited access to actual debugging tools that you can use with graphical projects, along with the fact that the integrated display is very very slow. This is all to say that if you even did get it working, it would be not be a fun experience to work with this kind of software in the Replit environment.

If you have a computer that you can develop on, I highly recommend just porting over the code to your own local environment; you won’t regret it. And if you have any questions about that I’d be happy to try and help.