Skip to content

Instantly share code, notes, and snippets.

View arkenidar's full-sized avatar

Dario Cangialosi arkenidar

View GitHub Profile
@lalitshankarchowdhury
lalitshankarchowdhury / Main.cpp
Created January 19, 2024 05:28
OpenGL triangle interpolated colors code
#include <spdlog/spdlog.h>
#include <glad/glad.h>
#include <GLFW/glfw3.h>
const char* vertShaderSource = R"(
#version 330 core
layout(location = 0) in vec3 aPos;
layout(location = 1) in vec3 aColor;
out vec3 vertexColor;
void main() {
@arkenidar
arkenidar / ffi-sdl.lua
Created November 11, 2022 21:11 — forked from creationix/ffi-sdl.lua
Using SDL from luajit's built-in ffi module
-- load the luajit ffi module
local ffi = require "ffi"
-- Parse the C API header
-- It's generated with:
--
-- echo '#include <SDL.h>' > stub.c
-- gcc -I /usr/include/SDL -E stub.c | grep -v '^#' > ffi_SDL.h
--
ffi.cdef(io.open('ffi_SDL.h', 'r'):read('*a'))
-- Load the shared object
@arkenidar
arkenidar / how_to_build_wlua_for_windows.md
Last active July 20, 2023 15:08 — forked from Egor-Skriptunoff/how_to_build_wlua_for_windows.md
How to build windowless* #Lua for #Windows (* meaning: no visible console for standard console output, no "console window", like pythonw.exe )

What is "windowless Lua"?

Windowless Lua does not create a console window.
It runs invisible for user.

Please note that "windowless" means "doesn't have stdin, stdout and stderr".
You will not be able to see error message.
io.read(), io.write() and print() in your Lua script will not work.
But in some situations invisible Lua is just what you need very much.
For example, to avoid a GUI application (especially a game) to lose input focus when some background Lua script is started.

@arkenidar
arkenidar / sdl2-gl.c
Created May 30, 2022 12:25
SDL2 with OpenGL for 3D (OpenGL with "windowing" requires SDL2 (or SDL1) or e.g. freeGLUT (GLUT implementation) )
// sdl2-gl.c (filename)
// SDL2 with OpenGL for 3D (OpenGL with "windowing" requires SDL2 (or SDL1) or e.g. freeGLUT (GLUT implementation) )
/* gcc sdl2-gl.c `sdl2-config --cflags --libs` -lopengl32 -lglu32 && ./a */
/*
https://www.libsdl.org/release/SDL-1.2.15/docs/html/guidevideoopengl.html ||
SDL_Delay( 30 ); // added ||
ported from SDL1 to SDL2
@arkenidar
arkenidar / echo.lua
Last active October 11, 2021 12:56 — forked from whiler/echo.lua
Simple TCP Echo Server in Lua
-- sudo luarocks install luasocket
-- sudo apt install lua-socket
local socket=require("socket")
local server=assert(socket.bind("localhost",9999))
server:settimeout(0) -- for server:accept()
local ip,port=server:getsockname()
print("ncat".." "..ip.." "..port)
@giuliohome
giuliohome / StandardShading.fragmentshader
Last active January 16, 2024 22:37
example for GTK GL Area issue
#version 330 core
// Interpolated values from the vertex shaders
in vec2 UV;
in vec3 Position_worldspace;
in vec3 Normal_cameraspace;
in vec3 EyeDirection_cameraspace;
in vec3 LightDirection_cameraspace;
// Ouput data
@Egor-Skriptunoff
Egor-Skriptunoff / how_to_install_lua_and_luajit_on_windows.md
Last active July 11, 2024 15:24
How to install Lua and LuaJIT on Windows

How to install Lua and LuaJIT on 64-bit Windows

  1. Download the latest Lua and LuaJIT sources

    • Create temporary folder for Lua sources.
      I assume you would use C:\Temp\ folder.

    • Visit Lua FTP webpage and download the latest Lua source archive, currently it is lua-5.4.3.tar.gz

  • Use suitable software (7-Zip, WinRar, WinZip or TotalCommander) to unpack the archive.
@Egor-Skriptunoff
Egor-Skriptunoff / how_to_build_wlua_for_windows.md
Created May 22, 2021 22:16
How to build windowless Lua for Windows

What is "windowless Lua"?

Windowless Lua does not create a console window.
It runs invisible for user.

Please note that "windowless" means "doesn't have stdin, stdout and stderr".
You will not be able to see error message.
io.read(), io.write() and print() in your Lua script will not work.
But in some situations invisible Lua is just what you need very much.
For example, to avoid a GUI application (especially a game) to lose input focus when some background Lua script is started.

@YukiSnowy
YukiSnowy / main.cpp
Last active March 20, 2024 19:10
example SDL2 Vulkan application
// g++ *.cpp -o vulkan -lSDL2main -lSDL2 -lvulkan-1
// https://vulkan-tutorial.com/
#include <iostream>
using namespace std;
#include <SDL2/SDL.h>
SDL_Window *window;
char* window_name = "example SDL2 Vulkan application";
@Fuwn
Fuwn / xp.md
Last active July 14, 2024 13:42
Windows XP All Editions Universal Product Keys Collection.

Windows XP Logo

Although Microsoft does not support Windows XP updates any more, I'm sure there are still many users using it due to their personal habits or job demands. Therefore, XP's product keys may be necessary even now. Here lies the most comprehensive list of Windows XP product keys.

The following CD keys are official and original from Microsoft, mainly used for Windows XP Professional Service Pack 2/3 VOL/VLK system images, which are the easiest ones to find on the Internet.