This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# mkdir dist\win | |
# cmake -G "MinGW Makefiles" -S . -B dist/win -DSDL3_DIR=E:/libs/sdl3-desktop-prefix/lib/cmake/SDL3 | |
# cmake -G "MinGW Makefiles" -S . -B dist/win -DSDL3_DIR=E:/libs/sdl3-libs/SDL3-devel-3.1.3-mingw/SDL3-3.1.3/x86_64-w64-mingw32/lib/cmake/SDL3 | |
# cd dist/win | |
# mingw32-make | |
# app | |
cmake_minimum_required(VERSION 3.20) | |
project(background_color_opengl_sdl3_cpp) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import sys | |
import os | |
from PyQt6.QtCore import QUrl | |
from PyQt6.QtWebEngineCore import QWebEngineSettings | |
from PyQt6.QtWebEngineWidgets import QWebEngineView | |
from PyQt6.QtWidgets import QApplication, QVBoxLayout, QWidget | |
class Widget(QWidget): |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from OpenGL.GL import * | |
def initFBO(offscreenWidth, offscreenHeight): | |
# Create a texture object and set its size and parameters | |
shadowMapTexture = glGenTextures(1) | |
glBindTexture(GL_TEXTURE_2D, shadowMapTexture) | |
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_LINEAR) | |
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_LINEAR) | |
glTexImage2D(GL_TEXTURE_2D, 0, GL_RGBA, offscreenWidth, offscreenHeight, |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// $ em++ -lwebsocket.js -o index.html main.cpp | |
#include <emscripten/emscripten.h> | |
#include <emscripten/websocket.h> | |
#include <stdio.h> | |
EM_BOOL onopen(int eventType, const EmscriptenWebSocketOpenEvent *websocketEvent, void *userData) { | |
puts("onopen"); | |
EMSCRIPTEN_RESULT result; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <QtGui/QOpenGLExtraFunctions> | |
#include <QtGui/QSurfaceFormat> | |
#include <QtGui/QVector3D> | |
#include <QtOpenGL/QOpenGLFramebufferObject> | |
#include <QtWidgets/QApplication> | |
#include <QtWidgets/QLabel> | |
#include <QtWidgets/QWidget> | |
#include <QtWidgets/QVBoxLayout> | |
#include <QtOpenGLWidgets/QOpenGLWidget> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <QtGui/QOpenGLExtraFunctions> | |
#include <QtGui/QSurfaceFormat> | |
#include <QtGui/QVector3D> | |
#include <QtOpenGL/QOpenGLFramebufferObject> | |
#include <QtWidgets/QApplication> | |
#include <QtWidgets/QLabel> | |
#include <QtWidgets/QWidget> | |
#include <QtWidgets/QVBoxLayout> | |
#include <QtOpenGLWidgets/QOpenGLWidget> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const jsBeautify = require('js-beautify')['js_beautify']; | |
const fs = require('fs'); | |
const glob = require('glob'); | |
const options = { | |
indent_size: 4, | |
indent_char: ' ', | |
indent_with_tabs: false, | |
eol: '\n', | |
end_with_newline: true, |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// https://coliru.stacked-crooked.com/a/7765d15fe603a3d9 | |
// https://gamedev.stackexchange.com/a/196955/115807 | |
#include <iostream> | |
#include <string> | |
#include <vector> | |
#include <memory> | |
#include <map> | |
struct b2Fixture; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
QT += core gui widgets | |
SOURCES += main.cpp | |
TARGET = app |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Build: | |
# | |
# as -o hello.obj | |
# ld -o hello.exe hello.obj -L C:\\tools\\mingw64\\x86_64-w64-mingw32\\lib -lkernel32 | |
# | |
# Requires MinGW | |
.extern GetStdHandle | |
.extern WriteFile | |
.extern ExitProcess |