skip to main content
paste
bin
.ca
type · paste · share
⌘
K
Sign in
?
Account
More
▾
Docs
Family
The bin family
pastebin.ca
hub
Share text and code with expiry and privacy controls.
imagebin.ca
Upload and share images with direct links.
filebin.ca
Drop a file and get a shareable link.
notebin.ca
Write Markdown notes with durable links.
turl.ca
Short, reputation-checked links.
attn.ca
Notifications and alerts for your services.
voicebin.ca
Record and share short voice clips.
dnsbin.ca
Inspect DNS and debug records.
← back to paste
›
Edit / fork
Untitled paste
#4yJAarLHu6
public / public
new version
anonymous
created 2 days ago
Expires in 3 months
1.8 KB
syntax:
text
Your changes create a new paste linked to this one — the original is untouched.
new version
Your changes create a new paste linked to this one — the original is untouched.
Title (optional)
Filename
Syntax
text
text
bash
c
cpp
css
diff
dockerfile
go
html
ini
java
javascript
json
kotlin
lua
makefile
markdown
nginx
php
python
ruby
rust
shellscript
sql
swift
toml
typescript
xml
yaml
Visibility
Public feed
Access
public
Expires
90 days
10 min
1 hour
1 day
7 days
30 days
90 days
custom…
Custom expiry
Change note
(optional)
Anyone can find this paste in the public feed. Choose Unlisted to share it only by link.
Create new version
Cancel
Paste or type…
#include <GL/glx.h> #include <SDL3/SDL.h> #include <iostream> const unsigned int SCR_WIDTH = 800; const unsigned int SCR_HEIGHT = 600; typedef void (*GL_CLEARCOLOR_F)(GLfloat, GLfloat, GLfloat, GLfloat); typedef void (*GL_CLEAR_F)(GLbitfield); typedef void (*GL_VIEWPORT_F)(GLint, GLint, GLsizei, GLsizei); int main() { GL_CLEARCOLOR_F glClearColor = (GL_CLEARCOLOR_F)glXGetProcAddress((const GLubyte*)"glClearColor"); GL_CLEAR_F glClear = (GL_CLEAR_F)glXGetProcAddress((const GLubyte*)"glCLear"); GL_VIEWPORT_F glViewport = (GL_VIEWPORT_F)glXGetProcAddress((const GLubyte*)"glViewport"); if (!SDL_Init(SDL_INIT_VIDEO)) std::cout << "Can't init SDL: " << SDL_GetError() << std::endl; SDL_GL_SetAttribute(SDL_GL_CONTEXT_PROFILE_MASK, SDL_GL_CONTEXT_PROFILE_CORE); SDL_GL_SetAttribute(SDL_GL_CONTEXT_MAJOR_VERSION, 3); SDL_GL_SetAttribute(SDL_GL_CONTEXT_MINOR_VERSION, 3); SDL_GL_SetAttribute(SDL_GL_DOUBLEBUFFER, 1); SDL_Window* window = SDL_CreateWindow("Test", SCR_WIDTH, SCR_HEIGHT, SDL_WINDOW_OPENGL); if (!window) std::cout << "Can't create window: " << SDL_GetError() << std::endl; SDL_GLContext context = SDL_GL_CreateContext(window); if (!context) std::cout << "Can't create context: " << SDL_GetError() << std::endl; SDL_GL_SetSwapInterval(1); glViewport(0, 0, SCR_WIDTH, SCR_HEIGHT); bool shouldQuit = false; SDL_Event event; while (!shouldQuit) { while (SDL_PollEvent(&event)) if (event.type == SDL_EVENT_QUIT) shouldQuit = true; glClearColor(1.0f, 0.0f, 0.0f, 1.0f); glClear(GL_COLOR_BUFFER_BIT); SDL_GL_SwapWindow(window); } SDL_GL_DestroyContext(context); SDL_DestroyWindow(window); SDL_Quit(); return 0; }