passer au contenu principal
paste
bin
.ca
type · paste · share
⌘
K
Se connecter
?
Compte
Plus
▾
Docs
Famille
La famille bin
pastebin.ca
pôle
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.
← retour au collage
›
Modifier / dupliquer
Collage sans titre
#4yJAarLHu6
public / public
nouvelle version
anonyme
créé 2 days ago
Expire dans 3 months
1.8 KB
syntaxe:
text
Vos changements créent un nouveau collage lié à celui-ci — l’original reste intact.
nouvelle version
Vos changements créent un nouveau collage lié à celui-ci — l’original reste intact.
Titre (facultatif)
Nom de fichier
Syntaxe
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
Visibilité
Fil public
Accès
public
Expire
90 jours
10 min
1 heure
1 jour
7 jours
30 jours
90 jours
personnalisé…
Expiration personnalisée
Note de changement
(facultatif)
Tout le monde peut trouver ce collage dans le fil public. Choisissez Non répertorié pour le partager uniquement par lien.
Créer une nouvelle version
Annuler
Collez ou tapez…
#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; }