Skip to content

Instantly share code, notes, and snippets.

@mieki256
mieki256 / 01_ssstars_opengl.c
Created January 11, 2024 11:59
Like ssstars screensaver for C and OpenGL
// like star screensaver (ssstar.scr) by OpenGL
//
// by mieki256
// License : CC0 / Public Domain
// Last updated: <2024/01/10 05:31:11 +0900>
#include <stdio.h>
#include <stdlib.h>
#include <windows.h>
#include <mmsystem.h>
@mieki256
mieki256 / 01_ssstar_opengl.py
Created January 9, 2024 12:03
Like star screensaver by PyOpenGL
#!python
# -*- mode: python; Encoding: utf-8; coding: utf-8 -*-
# Last updated: <2024/01/08 11:02:26 +0900>
"""
Drawing process like a star screensaver by PyOpenGL
Windows10 x64 22H2 + Python 3.10.10 64bit + PyOpenGL 3.1.6
"""
@mieki256
mieki256 / 01_gl_bound_ball.c
Last active September 18, 2022 13:57
Bound ball animation by using C + OpenGL + freeglut 3.0.0. use MinGW (gcc 9.2.0).
/* Last updated: <2022/09/18 11:40:29 +0900> */
/*
OpenGL Bound Ball by mieki256
ESC, q, key : Exit
f key : Display FPS ON/OFF
Use Windows10 x64 21H2 + MinGW(gcc 9.2.0) + freeglut 3.0.0 (freeglut-MinGW-3.0.0-1.mp.zip)
Build:
@mieki256
mieki256 / 01_bound_ball.py
Created September 18, 2022 12:42
Bound ball animation by using PyOpenGL
#!python
# -*- mode: python; Encoding: utf-8; coding: utf-8 -*-
# Last updated: <2022/09/18 21:40:32 +0900>
"""
GL bound ball by mieki256.
License: CC0 / Public Domain.
ESC, q : Exit
f : Display FPS
@mieki256
mieki256 / all-layers-process-serial-number_m256.scm
Last active September 12, 2022 11:52
GIMPの全レイヤーを連番リネーム、または連番テキストを描画するScript-Fu。Windows7 x64 + GIMP 2.8.0 Portable、GIMP 2.6.11 で動作確認した。
;;
;; 全レイヤーに対し、以下のどちらかを行う Script-fu スクリプト
;; ・レイヤー名を連番でリネーム
;; ・連番テキストを描画
;;
;; * レイヤーメニューに追加される
;; * 連番文字列を描画する際に使用するフォント種類は、
;; 事前にフォントタブ内などで選択しておく。
;; また、現在の前景色で描画される。
;;
@mieki256
mieki256 / m256_layers_offsets_dump_0.0.1.py
Created September 12, 2022 11:41
GIMPの全レイヤー情報をテキストで保存するPython-Fu(GIMP-Python)スクリプト。Windows7 x64、GIMP 2.8.0 Portable + Python 2.7.2、GIMP 2.6.11 + Python 2.6.6 で動作確認した。
#!/usr/bin/env python
# -*- coding: utf-8 -*-
# -*- mode: python; Encoding: utf8n -*-
u"""
全レイヤーの、左上座標、幅、高さ、をテキスト出力保存する.
by mieki256
0.0.1 2012.08.06 GIMP2.8、GIMP2.6用に作成。
@mieki256
mieki256 / fullscrpyglet.py
Last active September 12, 2022 11:43
pygletでフルスクリーン表示等をするサンプル・Windows7 x64 (+ GeForce 9800GTGE) + Python 2.6.6 32bit + pyglet 1.2 alpha 1 で動作確認。
#!/usr/bin/env python
# -*- coding: utf-8 -*-
# -*- mode: python;Encoding: utf8n -*-
"""
Pygletサンプル
BG表示、スプライト表示、oggのループ再生を行う
- 座標は、左下が(0,0)になってることに注意
@mieki256
mieki256 / pygameopengltest2.py
Last active April 10, 2024 01:31
PyGame+PyOpenGLのサンプル。Windows7 x64 + Python 2.7.8 32bit + PyGame 1.9.2a0 + PyOpenGL で動作確認した。
#!/usr/bin/env python
# -*- coding: utf-8 -*-
u"""
PyGame + OpenGLのテストサンプル
- Pキー : 平行投影/透視投影の切り替え
- Wキー : ワイヤーフレーム/ソリッド表示の切り替え
- Lキー : 照明のon/off
- Tキー : テクスチャ設定の切り替え(3種類)
@mieki256
mieki256 / yliluoma_ordered_dither.py
Last active January 29, 2023 08:28
Yliluoma's ordered dithering algorithm 1, 2, 3. Python version.
#!python
# -*- mode: python; Encoding: utf-8; coding: utf-8 -*-
# Last updated: <2022/07/13 01:32:08 +0900>
"""
Yliluoma's ordered dithering algorithm 1, 2, 3 and adobe like
Arbitrary-palette positional dithering algorithm
https://bisqwit.iki.fi/story/howto/dither/jy/
Usage:
@mieki256
mieki256 / gpl2aco.py
Created July 8, 2021 17:00
Convert GIMP palette (.gpl) to Photoshop color swatch (.aco)
#!python
# -*- mode: python; Encoding: utf-8; coding: utf-8 -*-
# Last updated: <2021/07/08 04:18:55 +0900>
"""
Convert GIMP palette (.gpl) to Photoshop color swatch (.aco).
usage: python gpl2aco.py GPL_FILE ACO_FILE
Windows10 x64 20H2 + Python 3.9.5 64bit
"""