suwako / OpenGL-Rust アーカイブ

このリポジトリはアーカイブされています。読むだけで、プッシュやイシューの変更は出来ません。

最初コミット.

諏訪子 <suwako@076.moe>、2026-04-28 23:52
コミット 61c165ddffe7e96a09b8d8cbd57df9fb5c7901b3 ・ファイルを見る

6個のファイル、+1336 -0

追加 .gitignore
@@ -0,0 +1,1 @@
1+/target
追加 Cargo.lock
@@ -0,0 +1,1127 @@
1+# This file is automatically @generated by Cargo.
2+# It is not intended for manual editing.
3+version = 4
4+
5+[[package]]
6+name = "adler2"
7+version = "2.0.1"
8+source = "registry+https://github.com/rust-lang/crates.io-index"
9+checksum = "320119579fcad9c21884f5c4861d16174d0e06250625266f50fe6898340abefa"
10+
11+[[package]]
12+name = "aligned"
13+version = "0.4.3"
14+source = "registry+https://github.com/rust-lang/crates.io-index"
15+checksum = "ee4508988c62edf04abd8d92897fca0c2995d907ce1dfeaf369dac3716a40685"
16+dependencies = [
17+ "as-slice",
18+]
19+
20+[[package]]
21+name = "aligned-vec"
22+version = "0.6.4"
23+source = "registry+https://github.com/rust-lang/crates.io-index"
24+checksum = "dc890384c8602f339876ded803c97ad529f3842aba97f6392b3dba0dd171769b"
25+dependencies = [
26+ "equator",
27+]
28+
29+[[package]]
30+name = "anyhow"
31+version = "1.0.102"
32+source = "registry+https://github.com/rust-lang/crates.io-index"
33+checksum = "7f202df86484c868dbad7eaa557ef785d5c66295e41b460ef922eca0723b842c"
34+
35+[[package]]
36+name = "arbitrary"
37+version = "1.4.2"
38+source = "registry+https://github.com/rust-lang/crates.io-index"
39+checksum = "c3d036a3c4ab069c7b410a2ce876bd74808d2d0888a82667669f8e783a898bf1"
40+
41+[[package]]
42+name = "arg_enum_proc_macro"
43+version = "0.3.4"
44+source = "registry+https://github.com/rust-lang/crates.io-index"
45+checksum = "0ae92a5119aa49cdbcf6b9f893fe4e1d98b04ccbf82ee0584ad948a44a734dea"
46+dependencies = [
47+ "proc-macro2",
48+ "quote",
49+ "syn",
50+]
51+
52+[[package]]
53+name = "arrayvec"
54+version = "0.7.6"
55+source = "registry+https://github.com/rust-lang/crates.io-index"
56+checksum = "7c02d123df017efcdfbd739ef81735b36c5ba83ec3c59c80a9d7ecc718f92e50"
57+
58+[[package]]
59+name = "as-slice"
60+version = "0.2.1"
61+source = "registry+https://github.com/rust-lang/crates.io-index"
62+checksum = "516b6b4f0e40d50dcda9365d53964ec74560ad4284da2e7fc97122cd83174516"
63+dependencies = [
64+ "stable_deref_trait",
65+]
66+
67+[[package]]
68+name = "autocfg"
69+version = "1.5.0"
70+source = "registry+https://github.com/rust-lang/crates.io-index"
71+checksum = "c08606f8c3cbf4ce6ec8e28fb0014a2c086708fe954eaa885384a6165172e7e8"
72+
73+[[package]]
74+name = "av-scenechange"
75+version = "0.14.1"
76+source = "registry+https://github.com/rust-lang/crates.io-index"
77+checksum = "0f321d77c20e19b92c39e7471cf986812cbb46659d2af674adc4331ef3f18394"
78+dependencies = [
79+ "aligned",
80+ "anyhow",
81+ "arg_enum_proc_macro",
82+ "arrayvec",
83+ "log",
84+ "num-rational",
85+ "num-traits",
86+ "pastey",
87+ "rayon",
88+ "thiserror",
89+ "v_frame",
90+ "y4m",
91+]
92+
93+[[package]]
94+name = "av1-grain"
95+version = "0.2.5"
96+source = "registry+https://github.com/rust-lang/crates.io-index"
97+checksum = "8cfddb07216410377231960af4fcab838eaa12e013417781b78bd95ee22077f8"
98+dependencies = [
99+ "anyhow",
100+ "arrayvec",
101+ "log",
102+ "nom",
103+ "num-rational",
104+ "v_frame",
105+]
106+
107+[[package]]
108+name = "avif-serialize"
109+version = "0.8.8"
110+source = "registry+https://github.com/rust-lang/crates.io-index"
111+checksum = "375082f007bd67184fb9c0374614b29f9aaa604ec301635f72338bb65386a53d"
112+dependencies = [
113+ "arrayvec",
114+]
115+
116+[[package]]
117+name = "bit_field"
118+version = "0.10.3"
119+source = "registry+https://github.com/rust-lang/crates.io-index"
120+checksum = "1e4b40c7323adcfc0a41c4b88143ed58346ff65a288fc144329c5c45e05d70c6"
121+
122+[[package]]
123+name = "bitflags"
124+version = "1.3.2"
125+source = "registry+https://github.com/rust-lang/crates.io-index"
126+checksum = "bef38d45163c2f1dde094a7dfd33ccf595c92905c8f8f4fdc18d06fb1037718a"
127+
128+[[package]]
129+name = "bitflags"
130+version = "2.11.0"
131+source = "registry+https://github.com/rust-lang/crates.io-index"
132+checksum = "843867be96c8daad0d758b57df9392b6d8d271134fce549de6ce169ff98a92af"
133+
134+[[package]]
135+name = "bitstream-io"
136+version = "4.9.0"
137+source = "registry+https://github.com/rust-lang/crates.io-index"
138+checksum = "60d4bd9d1db2c6bdf285e223a7fa369d5ce98ec767dec949c6ca62863ce61757"
139+dependencies = [
140+ "core2",
141+]
142+
143+[[package]]
144+name = "built"
145+version = "0.8.0"
146+source = "registry+https://github.com/rust-lang/crates.io-index"
147+checksum = "f4ad8f11f288f48ca24471bbd51ac257aaeaaa07adae295591266b792902ae64"
148+
149+[[package]]
150+name = "bumpalo"
151+version = "3.20.2"
152+source = "registry+https://github.com/rust-lang/crates.io-index"
153+checksum = "5d20789868f4b01b2f2caec9f5c4e0213b41e3e5702a50157d699ae31ced2fcb"
154+
155+[[package]]
156+name = "bytemuck"
157+version = "1.25.0"
158+source = "registry+https://github.com/rust-lang/crates.io-index"
159+checksum = "c8efb64bd706a16a1bdde310ae86b351e4d21550d98d056f22f8a7f7a2183fec"
160+
161+[[package]]
162+name = "byteorder-lite"
163+version = "0.1.0"
164+source = "registry+https://github.com/rust-lang/crates.io-index"
165+checksum = "8f1fe948ff07f4bd06c30984e69f5b4899c516a3ef74f34df92a2df2ab535495"
166+
167+[[package]]
168+name = "cc"
169+version = "1.2.59"
170+source = "registry+https://github.com/rust-lang/crates.io-index"
171+checksum = "b7a4d3ec6524d28a329fc53654bbadc9bdd7b0431f5d65f1a56ffb28a1ee5283"
172+dependencies = [
173+ "find-msvc-tools",
174+ "jobserver",
175+ "libc",
176+ "shlex",
177+]
178+
179+[[package]]
180+name = "cfg-if"
181+version = "1.0.4"
182+source = "registry+https://github.com/rust-lang/crates.io-index"
183+checksum = "9330f8b2ff13f34540b44e946ef35111825727b38d33286ef986142615121801"
184+
185+[[package]]
186+name = "cmake"
187+version = "0.1.58"
188+source = "registry+https://github.com/rust-lang/crates.io-index"
189+checksum = "c0f78a02292a74a88ac736019ab962ece0bc380e3f977bf72e376c5d78ff0678"
190+dependencies = [
191+ "cc",
192+]
193+
194+[[package]]
195+name = "color_quant"
196+version = "1.1.0"
197+source = "registry+https://github.com/rust-lang/crates.io-index"
198+checksum = "3d7b894f5411737b7867f4827955924d7c254fc9f4d91a6aad6b097804b1018b"
199+
200+[[package]]
201+name = "core2"
202+version = "0.4.0"
203+source = "registry+https://github.com/rust-lang/crates.io-index"
204+checksum = "b49ba7ef1ad6107f8824dbe97de947cbaac53c44e7f9756a1fba0d37c1eec505"
205+dependencies = [
206+ "memchr",
207+]
208+
209+[[package]]
210+name = "crc32fast"
211+version = "1.5.0"
212+source = "registry+https://github.com/rust-lang/crates.io-index"
213+checksum = "9481c1c90cbf2ac953f07c8d4a58aa3945c425b7185c9154d67a65e4230da511"
214+dependencies = [
215+ "cfg-if",
216+]
217+
218+[[package]]
219+name = "crossbeam-deque"
220+version = "0.8.6"
221+source = "registry+https://github.com/rust-lang/crates.io-index"
222+checksum = "9dd111b7b7f7d55b72c0a6ae361660ee5853c9af73f70c3c2ef6858b950e2e51"
223+dependencies = [
224+ "crossbeam-epoch",
225+ "crossbeam-utils",
226+]
227+
228+[[package]]
229+name = "crossbeam-epoch"
230+version = "0.9.18"
231+source = "registry+https://github.com/rust-lang/crates.io-index"
232+checksum = "5b82ac4a3c2ca9c3460964f020e1402edd5753411d7737aa39c3714ad1b5420e"
233+dependencies = [
234+ "crossbeam-utils",
235+]
236+
237+[[package]]
238+name = "crossbeam-utils"
239+version = "0.8.21"
240+source = "registry+https://github.com/rust-lang/crates.io-index"
241+checksum = "d0a5c400df2834b80a4c3327b3aad3a4c4cd4de0629063962b03235697506a28"
242+
243+[[package]]
244+name = "crunchy"
245+version = "0.2.4"
246+source = "registry+https://github.com/rust-lang/crates.io-index"
247+checksum = "460fbee9c2c2f33933d720630a6a0bac33ba7053db5344fac858d4b8952d77d5"
248+
249+[[package]]
250+name = "either"
251+version = "1.15.0"
252+source = "registry+https://github.com/rust-lang/crates.io-index"
253+checksum = "48c757948c5ede0e46177b7add2e67155f70e33c07fea8284df6576da70b3719"
254+
255+[[package]]
256+name = "equator"
257+version = "0.4.2"
258+source = "registry+https://github.com/rust-lang/crates.io-index"
259+checksum = "4711b213838dfee0117e3be6ac926007d7f433d7bbe33595975d4190cb07e6fc"
260+dependencies = [
261+ "equator-macro",
262+]
263+
264+[[package]]
265+name = "equator-macro"
266+version = "0.4.2"
267+source = "registry+https://github.com/rust-lang/crates.io-index"
268+checksum = "44f23cf4b44bfce11a86ace86f8a73ffdec849c9fd00a386a53d278bd9e81fb3"
269+dependencies = [
270+ "proc-macro2",
271+ "quote",
272+ "syn",
273+]
274+
275+[[package]]
276+name = "exr"
277+version = "1.74.0"
278+source = "registry+https://github.com/rust-lang/crates.io-index"
279+checksum = "4300e043a56aa2cb633c01af81ca8f699a321879a7854d3896a0ba89056363be"
280+dependencies = [
281+ "bit_field",
282+ "half",
283+ "lebe",
284+ "miniz_oxide",
285+ "rayon-core",
286+ "smallvec",
287+ "zune-inflate",
288+]
289+
290+[[package]]
291+name = "fax"
292+version = "0.2.6"
293+source = "registry+https://github.com/rust-lang/crates.io-index"
294+checksum = "f05de7d48f37cd6730705cbca900770cab77a89f413d23e100ad7fad7795a0ab"
295+dependencies = [
296+ "fax_derive",
297+]
298+
299+[[package]]
300+name = "fax_derive"
301+version = "0.2.0"
302+source = "registry+https://github.com/rust-lang/crates.io-index"
303+checksum = "a0aca10fb742cb43f9e7bb8467c91aa9bcb8e3ffbc6a6f7389bb93ffc920577d"
304+dependencies = [
305+ "proc-macro2",
306+ "quote",
307+ "syn",
308+]
309+
310+[[package]]
311+name = "fdeflate"
312+version = "0.3.7"
313+source = "registry+https://github.com/rust-lang/crates.io-index"
314+checksum = "1e6853b52649d4ac5c0bd02320cddc5ba956bdb407c4b75a2c6b75bf51500f8c"
315+dependencies = [
316+ "simd-adler32",
317+]
318+
319+[[package]]
320+name = "find-msvc-tools"
321+version = "0.1.9"
322+source = "registry+https://github.com/rust-lang/crates.io-index"
323+checksum = "5baebc0774151f905a1a2cc41989300b1e6fbb29aff0ceffa1064fdd3088d582"
324+
325+[[package]]
326+name = "flate2"
327+version = "1.1.9"
328+source = "registry+https://github.com/rust-lang/crates.io-index"
329+checksum = "843fba2746e448b37e26a819579957415c8cef339bf08564fe8b7ddbd959573c"
330+dependencies = [
331+ "crc32fast",
332+ "miniz_oxide",
333+]
334+
335+[[package]]
336+name = "getrandom"
337+version = "0.3.4"
338+source = "registry+https://github.com/rust-lang/crates.io-index"
339+checksum = "899def5c37c4fd7b2664648c28120ecec138e4d395b459e5ca34f9cce2dd77fd"
340+dependencies = [
341+ "cfg-if",
342+ "libc",
343+ "r-efi",
344+ "wasip2",
345+]
346+
347+[[package]]
348+name = "gif"
349+version = "0.14.2"
350+source = "registry+https://github.com/rust-lang/crates.io-index"
351+checksum = "ee8cfcc411d9adbbaba82fb72661cc1bcca13e8bba98b364e62b2dba8f960159"
352+dependencies = [
353+ "color_quant",
354+ "weezl",
355+]
356+
357+[[package]]
358+name = "gl"
359+version = "0.14.0"
360+source = "registry+https://github.com/rust-lang/crates.io-index"
361+checksum = "a94edab108827d67608095e269cf862e60d920f144a5026d3dbcfd8b877fb404"
362+dependencies = [
363+ "gl_generator",
364+]
365+
366+[[package]]
367+name = "gl_generator"
368+version = "0.14.0"
369+source = "registry+https://github.com/rust-lang/crates.io-index"
370+checksum = "1a95dfc23a2b4a9a2f5ab41d194f8bfda3cabec42af4e39f08c339eb2a0c124d"
371+dependencies = [
372+ "khronos_api",
373+ "log",
374+ "xml-rs",
375+]
376+
377+[[package]]
378+name = "glfw"
379+version = "0.62.0"
380+source = "registry+https://github.com/rust-lang/crates.io-index"
381+checksum = "61c38183b2df227d4b59fcabc647ccc65d04ed9a14420ea9c1520e5ed09b6a79"
382+dependencies = [
383+ "bitflags 1.3.2",
384+ "glfw-sys",
385+ "image",
386+ "log",
387+ "objc2",
388+ "raw-window-handle",
389+ "winapi",
390+]
391+
392+[[package]]
393+name = "glfw-sys"
394+version = "8.0.0"
395+source = "registry+https://github.com/rust-lang/crates.io-index"
396+checksum = "b5b92fb706b28b5ccb8e93edb0b7fc8a153f626430abe8e354bc5e4ad29860b0"
397+dependencies = [
398+ "cmake",
399+ "pkg-config",
400+]
401+
402+[[package]]
403+name = "half"
404+version = "2.7.1"
405+source = "registry+https://github.com/rust-lang/crates.io-index"
406+checksum = "6ea2d84b969582b4b1864a92dc5d27cd2b77b622a8d79306834f1be5ba20d84b"
407+dependencies = [
408+ "cfg-if",
409+ "crunchy",
410+ "zerocopy",
411+]
412+
413+[[package]]
414+name = "image"
415+version = "0.25.10"
416+source = "registry+https://github.com/rust-lang/crates.io-index"
417+checksum = "85ab80394333c02fe689eaf900ab500fbd0c2213da414687ebf995a65d5a6104"
418+dependencies = [
419+ "bytemuck",
420+ "byteorder-lite",
421+ "color_quant",
422+ "exr",
423+ "gif",
424+ "image-webp",
425+ "moxcms",
426+ "num-traits",
427+ "png",
428+ "qoi",
429+ "ravif",
430+ "rayon",
431+ "rgb",
432+ "tiff",
433+ "zune-core",
434+ "zune-jpeg",
435+]
436+
437+[[package]]
438+name = "image-webp"
439+version = "0.2.4"
440+source = "registry+https://github.com/rust-lang/crates.io-index"
441+checksum = "525e9ff3e1a4be2fbea1fdf0e98686a6d98b4d8f937e1bf7402245af1909e8c3"
442+dependencies = [
443+ "byteorder-lite",
444+ "quick-error",
445+]
446+
447+[[package]]
448+name = "imgref"
449+version = "1.12.0"
450+source = "registry+https://github.com/rust-lang/crates.io-index"
451+checksum = "e7c5cedc30da3a610cac6b4ba17597bdf7152cf974e8aab3afb3d54455e371c8"
452+
453+[[package]]
454+name = "interpolate_name"
455+version = "0.2.4"
456+source = "registry+https://github.com/rust-lang/crates.io-index"
457+checksum = "c34819042dc3d3971c46c2190835914dfbe0c3c13f61449b2997f4e9722dfa60"
458+dependencies = [
459+ "proc-macro2",
460+ "quote",
461+ "syn",
462+]
463+
464+[[package]]
465+name = "itertools"
466+version = "0.14.0"
467+source = "registry+https://github.com/rust-lang/crates.io-index"
468+checksum = "2b192c782037fadd9cfa75548310488aabdbf3d2da73885b31bd0abd03351285"
469+dependencies = [
470+ "either",
471+]
472+
473+[[package]]
474+name = "jobserver"
475+version = "0.1.34"
476+source = "registry+https://github.com/rust-lang/crates.io-index"
477+checksum = "9afb3de4395d6b3e67a780b6de64b51c978ecf11cb9a462c66be7d4ca9039d33"
478+dependencies = [
479+ "getrandom",
480+ "libc",
481+]
482+
483+[[package]]
484+name = "khronos_api"
485+version = "3.1.0"
486+source = "registry+https://github.com/rust-lang/crates.io-index"
487+checksum = "e2db585e1d738fc771bf08a151420d3ed193d9d895a36df7f6f8a9456b911ddc"
488+
489+[[package]]
490+name = "lebe"
491+version = "0.5.3"
492+source = "registry+https://github.com/rust-lang/crates.io-index"
493+checksum = "7a79a3332a6609480d7d0c9eab957bca6b455b91bb84e66d19f5ff66294b85b8"
494+
495+[[package]]
496+name = "libc"
497+version = "0.2.184"
498+source = "registry+https://github.com/rust-lang/crates.io-index"
499+checksum = "48f5d2a454e16a5ea0f4ced81bd44e4cfc7bd3a507b61887c99fd3538b28e4af"
500+
501+[[package]]
502+name = "libfuzzer-sys"
503+version = "0.4.12"
504+source = "registry+https://github.com/rust-lang/crates.io-index"
505+checksum = "f12a681b7dd8ce12bff52488013ba614b869148d54dd79836ab85aafdd53f08d"
506+dependencies = [
507+ "arbitrary",
508+ "cc",
509+]
510+
511+[[package]]
512+name = "log"
513+version = "0.4.29"
514+source = "registry+https://github.com/rust-lang/crates.io-index"
515+checksum = "5e5032e24019045c762d3c0f28f5b6b8bbf38563a65908389bf7978758920897"
516+
517+[[package]]
518+name = "loop9"
519+version = "0.1.5"
520+source = "registry+https://github.com/rust-lang/crates.io-index"
521+checksum = "0fae87c125b03c1d2c0150c90365d7d6bcc53fb73a9acaef207d2d065860f062"
522+dependencies = [
523+ "imgref",
524+]
525+
526+[[package]]
527+name = "maybe-rayon"
528+version = "0.1.1"
529+source = "registry+https://github.com/rust-lang/crates.io-index"
530+checksum = "8ea1f30cedd69f0a2954655f7188c6a834246d2bcf1e315e2ac40c4b24dc9519"
531+dependencies = [
532+ "cfg-if",
533+ "rayon",
534+]
535+
536+[[package]]
537+name = "memchr"
538+version = "2.8.0"
539+source = "registry+https://github.com/rust-lang/crates.io-index"
540+checksum = "f8ca58f447f06ed17d5fc4043ce1b10dd205e060fb3ce5b979b8ed8e59ff3f79"
541+
542+[[package]]
543+name = "miniz_oxide"
544+version = "0.8.9"
545+source = "registry+https://github.com/rust-lang/crates.io-index"
546+checksum = "1fa76a2c86f704bdb222d66965fb3d63269ce38518b83cb0575fca855ebb6316"
547+dependencies = [
548+ "adler2",
549+ "simd-adler32",
550+]
551+
552+[[package]]
553+name = "moxcms"
554+version = "0.8.1"
555+source = "registry+https://github.com/rust-lang/crates.io-index"
556+checksum = "bb85c154ba489f01b25c0d36ae69a87e4a1c73a72631fc6c0eb6dde34a73e44b"
557+dependencies = [
558+ "num-traits",
559+ "pxfm",
560+]
561+
562+[[package]]
563+name = "new_debug_unreachable"
564+version = "1.0.6"
565+source = "registry+https://github.com/rust-lang/crates.io-index"
566+checksum = "650eef8c711430f1a879fdd01d4745a7deea475becfb90269c06775983bbf086"
567+
568+[[package]]
569+name = "nom"
570+version = "8.0.0"
571+source = "registry+https://github.com/rust-lang/crates.io-index"
572+checksum = "df9761775871bdef83bee530e60050f7e54b1105350d6884eb0fb4f46c2f9405"
573+dependencies = [
574+ "memchr",
575+]
576+
577+[[package]]
578+name = "noop_proc_macro"
579+version = "0.3.0"
580+source = "registry+https://github.com/rust-lang/crates.io-index"
581+checksum = "0676bb32a98c1a483ce53e500a81ad9c3d5b3f7c920c28c24e9cb0980d0b5bc8"
582+
583+[[package]]
584+name = "num-bigint"
585+version = "0.4.6"
586+source = "registry+https://github.com/rust-lang/crates.io-index"
587+checksum = "a5e44f723f1133c9deac646763579fdb3ac745e418f2a7af9cd0c431da1f20b9"
588+dependencies = [
589+ "num-integer",
590+ "num-traits",
591+]
592+
593+[[package]]
594+name = "num-derive"
595+version = "0.4.2"
596+source = "registry+https://github.com/rust-lang/crates.io-index"
597+checksum = "ed3955f1a9c7c0c15e092f9c887db08b1fc683305fdf6eb6684f22555355e202"
598+dependencies = [
599+ "proc-macro2",
600+ "quote",
601+ "syn",
602+]
603+
604+[[package]]
605+name = "num-integer"
606+version = "0.1.46"
607+source = "registry+https://github.com/rust-lang/crates.io-index"
608+checksum = "7969661fd2958a5cb096e56c8e1ad0444ac2bbcd0061bd28660485a44879858f"
609+dependencies = [
610+ "num-traits",
611+]
612+
613+[[package]]
614+name = "num-rational"
615+version = "0.4.2"
616+source = "registry+https://github.com/rust-lang/crates.io-index"
617+checksum = "f83d14da390562dca69fc84082e73e548e1ad308d24accdedd2720017cb37824"
618+dependencies = [
619+ "num-bigint",
620+ "num-integer",
621+ "num-traits",
622+]
623+
624+[[package]]
625+name = "num-traits"
626+version = "0.2.19"
627+source = "registry+https://github.com/rust-lang/crates.io-index"
628+checksum = "071dfc062690e90b734c0b2273ce72ad0ffa95f0c74596bc250dcfd960262841"
629+dependencies = [
630+ "autocfg",
631+]
632+
633+[[package]]
634+name = "objc-sys"
635+version = "0.3.5"
636+source = "registry+https://github.com/rust-lang/crates.io-index"
637+checksum = "cdb91bdd390c7ce1a8607f35f3ca7151b65afc0ff5ff3b34fa350f7d7c7e4310"
638+
639+[[package]]
640+name = "objc2"
641+version = "0.5.2"
642+source = "registry+https://github.com/rust-lang/crates.io-index"
643+checksum = "46a785d4eeff09c14c487497c162e92766fbb3e4059a71840cecc03d9a50b804"
644+dependencies = [
645+ "objc-sys",
646+ "objc2-encode",
647+]
648+
649+[[package]]
650+name = "objc2-encode"
651+version = "4.1.0"
652+source = "registry+https://github.com/rust-lang/crates.io-index"
653+checksum = "ef25abbcd74fb2609453eb695bd2f860d389e457f67dc17cafc8b8cbc89d0c33"
654+
655+[[package]]
656+name = "once_cell"
657+version = "1.21.4"
658+source = "registry+https://github.com/rust-lang/crates.io-index"
659+checksum = "9f7c3e4beb33f85d45ae3e3a1792185706c8e16d043238c593331cc7cd313b50"
660+
661+[[package]]
662+name = "opengl-render-rs"
663+version = "0.1.0"
664+dependencies = [
665+ "gl",
666+ "glfw",
667+]
668+
669+[[package]]
670+name = "paste"
671+version = "1.0.15"
672+source = "registry+https://github.com/rust-lang/crates.io-index"
673+checksum = "57c0d7b74b563b49d38dae00a0c37d4d6de9b432382b2892f0574ddcae73fd0a"
674+
675+[[package]]
676+name = "pastey"
677+version = "0.1.1"
678+source = "registry+https://github.com/rust-lang/crates.io-index"
679+checksum = "35fb2e5f958ec131621fdd531e9fc186ed768cbe395337403ae56c17a74c68ec"
680+
681+[[package]]
682+name = "pkg-config"
683+version = "0.3.32"
684+source = "registry+https://github.com/rust-lang/crates.io-index"
685+checksum = "7edddbd0b52d732b21ad9a5fab5c704c14cd949e5e9a1ec5929a24fded1b904c"
686+
687+[[package]]
688+name = "png"
689+version = "0.18.1"
690+source = "registry+https://github.com/rust-lang/crates.io-index"
691+checksum = "60769b8b31b2a9f263dae2776c37b1b28ae246943cf719eb6946a1db05128a61"
692+dependencies = [
693+ "bitflags 2.11.0",
694+ "crc32fast",
695+ "fdeflate",
696+ "flate2",
697+ "miniz_oxide",
698+]
699+
700+[[package]]
701+name = "ppv-lite86"
702+version = "0.2.21"
703+source = "registry+https://github.com/rust-lang/crates.io-index"
704+checksum = "85eae3c4ed2f50dcfe72643da4befc30deadb458a9b590d720cde2f2b1e97da9"
705+dependencies = [
706+ "zerocopy",
707+]
708+
709+[[package]]
710+name = "proc-macro2"
711+version = "1.0.106"
712+source = "registry+https://github.com/rust-lang/crates.io-index"
713+checksum = "8fd00f0bb2e90d81d1044c2b32617f68fcb9fa3bb7640c23e9c748e53fb30934"
714+dependencies = [
715+ "unicode-ident",
716+]
717+
718+[[package]]
719+name = "profiling"
720+version = "1.0.17"
721+source = "registry+https://github.com/rust-lang/crates.io-index"
722+checksum = "3eb8486b569e12e2c32ad3e204dbaba5e4b5b216e9367044f25f1dba42341773"
723+dependencies = [
724+ "profiling-procmacros",
725+]
726+
727+[[package]]
728+name = "profiling-procmacros"
729+version = "1.0.17"
730+source = "registry+https://github.com/rust-lang/crates.io-index"
731+checksum = "52717f9a02b6965224f95ca2a81e2e0c5c43baacd28ca057577988930b6c3d5b"
732+dependencies = [
733+ "quote",
734+ "syn",
735+]
736+
737+[[package]]
738+name = "pxfm"
739+version = "0.1.28"
740+source = "registry+https://github.com/rust-lang/crates.io-index"
741+checksum = "b5a041e753da8b807c9255f28de81879c78c876392ff2469cde94799b2896b9d"
742+
743+[[package]]
744+name = "qoi"
745+version = "0.4.1"
746+source = "registry+https://github.com/rust-lang/crates.io-index"
747+checksum = "7f6d64c71eb498fe9eae14ce4ec935c555749aef511cca85b5568910d6e48001"
748+dependencies = [
749+ "bytemuck",
750+]
751+
752+[[package]]
753+name = "quick-error"
754+version = "2.0.1"
755+source = "registry+https://github.com/rust-lang/crates.io-index"
756+checksum = "a993555f31e5a609f617c12db6250dedcac1b0a85076912c436e6fc9b2c8e6a3"
757+
758+[[package]]
759+name = "quote"
760+version = "1.0.45"
761+source = "registry+https://github.com/rust-lang/crates.io-index"
762+checksum = "41f2619966050689382d2b44f664f4bc593e129785a36d6ee376ddf37259b924"
763+dependencies = [
764+ "proc-macro2",
765+]
766+
767+[[package]]
768+name = "r-efi"
769+version = "5.3.0"
770+source = "registry+https://github.com/rust-lang/crates.io-index"
771+checksum = "69cdb34c158ceb288df11e18b4bd39de994f6657d83847bdffdbd7f346754b0f"
772+
773+[[package]]
774+name = "rand"
775+version = "0.9.2"
776+source = "registry+https://github.com/rust-lang/crates.io-index"
777+checksum = "6db2770f06117d490610c7488547d543617b21bfa07796d7a12f6f1bd53850d1"
778+dependencies = [
779+ "rand_chacha",
780+ "rand_core",
781+]
782+
783+[[package]]
784+name = "rand_chacha"
785+version = "0.9.0"
786+source = "registry+https://github.com/rust-lang/crates.io-index"
787+checksum = "d3022b5f1df60f26e1ffddd6c66e8aa15de382ae63b3a0c1bfc0e4d3e3f325cb"
788+dependencies = [
789+ "ppv-lite86",
790+ "rand_core",
791+]
792+
793+[[package]]
794+name = "rand_core"
795+version = "0.9.5"
796+source = "registry+https://github.com/rust-lang/crates.io-index"
797+checksum = "76afc826de14238e6e8c374ddcc1fa19e374fd8dd986b0d2af0d02377261d83c"
798+dependencies = [
799+ "getrandom",
800+]
801+
802+[[package]]
803+name = "rav1e"
804+version = "0.8.1"
805+source = "registry+https://github.com/rust-lang/crates.io-index"
806+checksum = "43b6dd56e85d9483277cde964fd1bdb0428de4fec5ebba7540995639a21cb32b"
807+dependencies = [
808+ "aligned-vec",
809+ "arbitrary",
810+ "arg_enum_proc_macro",
811+ "arrayvec",
812+ "av-scenechange",
813+ "av1-grain",
814+ "bitstream-io",
815+ "built",
816+ "cfg-if",
817+ "interpolate_name",
818+ "itertools",
819+ "libc",
820+ "libfuzzer-sys",
821+ "log",
822+ "maybe-rayon",
823+ "new_debug_unreachable",
824+ "noop_proc_macro",
825+ "num-derive",
826+ "num-traits",
827+ "paste",
828+ "profiling",
829+ "rand",
830+ "rand_chacha",
831+ "simd_helpers",
832+ "thiserror",
833+ "v_frame",
834+ "wasm-bindgen",
835+]
836+
837+[[package]]
838+name = "ravif"
839+version = "0.13.0"
840+source = "registry+https://github.com/rust-lang/crates.io-index"
841+checksum = "e52310197d971b0f5be7fe6b57530dcd27beb35c1b013f29d66c1ad73fbbcc45"
842+dependencies = [
843+ "avif-serialize",
844+ "imgref",
845+ "loop9",
846+ "quick-error",
847+ "rav1e",
848+ "rayon",
849+ "rgb",
850+]
851+
852+[[package]]
853+name = "raw-window-handle"
854+version = "0.6.2"
855+source = "registry+https://github.com/rust-lang/crates.io-index"
856+checksum = "20675572f6f24e9e76ef639bc5552774ed45f1c30e2951e1e99c59888861c539"
857+
858+[[package]]
859+name = "rayon"
860+version = "1.11.0"
861+source = "registry+https://github.com/rust-lang/crates.io-index"
862+checksum = "368f01d005bf8fd9b1206fb6fa653e6c4a81ceb1466406b81792d87c5677a58f"
863+dependencies = [
864+ "either",
865+ "rayon-core",
866+]
867+
868+[[package]]
869+name = "rayon-core"
870+version = "1.13.0"
871+source = "registry+https://github.com/rust-lang/crates.io-index"
872+checksum = "22e18b0f0062d30d4230b2e85ff77fdfe4326feb054b9783a3460d8435c8ab91"
873+dependencies = [
874+ "crossbeam-deque",
875+ "crossbeam-utils",
876+]
877+
878+[[package]]
879+name = "rgb"
880+version = "0.8.53"
881+source = "registry+https://github.com/rust-lang/crates.io-index"
882+checksum = "47b34b781b31e5d73e9fbc8689c70551fd1ade9a19e3e28cfec8580a79290cc4"
883+
884+[[package]]
885+name = "rustversion"
886+version = "1.0.22"
887+source = "registry+https://github.com/rust-lang/crates.io-index"
888+checksum = "b39cdef0fa800fc44525c84ccb54a029961a8215f9619753635a9c0d2538d46d"
889+
890+[[package]]
891+name = "shlex"
892+version = "1.3.0"
893+source = "registry+https://github.com/rust-lang/crates.io-index"
894+checksum = "0fda2ff0d084019ba4d7c6f371c95d8fd75ce3524c3cb8fb653a3023f6323e64"
895+
896+[[package]]
897+name = "simd-adler32"
898+version = "0.3.9"
899+source = "registry+https://github.com/rust-lang/crates.io-index"
900+checksum = "703d5c7ef118737c72f1af64ad2f6f8c5e1921f818cdcb97b8fe6fc69bf66214"
901+
902+[[package]]
903+name = "simd_helpers"
904+version = "0.1.0"
905+source = "registry+https://github.com/rust-lang/crates.io-index"
906+checksum = "95890f873bec569a0362c235787f3aca6e1e887302ba4840839bcc6459c42da6"
907+dependencies = [
908+ "quote",
909+]
910+
911+[[package]]
912+name = "smallvec"
913+version = "1.15.1"
914+source = "registry+https://github.com/rust-lang/crates.io-index"
915+checksum = "67b1b7a3b5fe4f1376887184045fcf45c69e92af734b7aaddc05fb777b6fbd03"
916+
917+[[package]]
918+name = "stable_deref_trait"
919+version = "1.2.1"
920+source = "registry+https://github.com/rust-lang/crates.io-index"
921+checksum = "6ce2be8dc25455e1f91df71bfa12ad37d7af1092ae736f3a6cd0e37bc7810596"
922+
923+[[package]]
924+name = "syn"
925+version = "2.0.117"
926+source = "registry+https://github.com/rust-lang/crates.io-index"
927+checksum = "e665b8803e7b1d2a727f4023456bbbbe74da67099c585258af0ad9c5013b9b99"
928+dependencies = [
929+ "proc-macro2",
930+ "quote",
931+ "unicode-ident",
932+]
933+
934+[[package]]
935+name = "thiserror"
936+version = "2.0.18"
937+source = "registry+https://github.com/rust-lang/crates.io-index"
938+checksum = "4288b5bcbc7920c07a1149a35cf9590a2aa808e0bc1eafaade0b80947865fbc4"
939+dependencies = [
940+ "thiserror-impl",
941+]
942+
943+[[package]]
944+name = "thiserror-impl"
945+version = "2.0.18"
946+source = "registry+https://github.com/rust-lang/crates.io-index"
947+checksum = "ebc4ee7f67670e9b64d05fa4253e753e016c6c95ff35b89b7941d6b856dec1d5"
948+dependencies = [
949+ "proc-macro2",
950+ "quote",
951+ "syn",
952+]
953+
954+[[package]]
955+name = "tiff"
956+version = "0.11.3"
957+source = "registry+https://github.com/rust-lang/crates.io-index"
958+checksum = "b63feaf3343d35b6ca4d50483f94843803b0f51634937cc2ec519fc32232bc52"
959+dependencies = [
960+ "fax",
961+ "flate2",
962+ "half",
963+ "quick-error",
964+ "weezl",
965+ "zune-jpeg",
966+]
967+
968+[[package]]
969+name = "unicode-ident"
970+version = "1.0.24"
971+source = "registry+https://github.com/rust-lang/crates.io-index"
972+checksum = "e6e4313cd5fcd3dad5cafa179702e2b244f760991f45397d14d4ebf38247da75"
973+
974+[[package]]
975+name = "v_frame"
976+version = "0.3.9"
977+source = "registry+https://github.com/rust-lang/crates.io-index"
978+checksum = "666b7727c8875d6ab5db9533418d7c764233ac9c0cff1d469aec8fa127597be2"
979+dependencies = [
980+ "aligned-vec",
981+ "num-traits",
982+ "wasm-bindgen",
983+]
984+
985+[[package]]
986+name = "wasip2"
987+version = "1.0.2+wasi-0.2.9"
988+source = "registry+https://github.com/rust-lang/crates.io-index"
989+checksum = "9517f9239f02c069db75e65f174b3da828fe5f5b945c4dd26bd25d89c03ebcf5"
990+dependencies = [
991+ "wit-bindgen",
992+]
993+
994+[[package]]
995+name = "wasm-bindgen"
996+version = "0.2.117"
997+source = "registry+https://github.com/rust-lang/crates.io-index"
998+checksum = "0551fc1bb415591e3372d0bc4780db7e587d84e2a7e79da121051c5c4b89d0b0"
999+dependencies = [
1000+ "cfg-if",
1001+ "once_cell",
1002+ "rustversion",
1003+ "wasm-bindgen-macro",
1004+ "wasm-bindgen-shared",
1005+]
1006+
1007+[[package]]
1008+name = "wasm-bindgen-macro"
1009+version = "0.2.117"
1010+source = "registry+https://github.com/rust-lang/crates.io-index"
1011+checksum = "7fbdf9a35adf44786aecd5ff89b4563a90325f9da0923236f6104e603c7e86be"
1012+dependencies = [
1013+ "quote",
1014+ "wasm-bindgen-macro-support",
1015+]
1016+
1017+[[package]]
1018+name = "wasm-bindgen-macro-support"
1019+version = "0.2.117"
1020+source = "registry+https://github.com/rust-lang/crates.io-index"
1021+checksum = "dca9693ef2bab6d4e6707234500350d8dad079eb508dca05530c85dc3a529ff2"
1022+dependencies = [
1023+ "bumpalo",
1024+ "proc-macro2",
1025+ "quote",
1026+ "syn",
1027+ "wasm-bindgen-shared",
1028+]
1029+
1030+[[package]]
1031+name = "wasm-bindgen-shared"
1032+version = "0.2.117"
1033+source = "registry+https://github.com/rust-lang/crates.io-index"
1034+checksum = "39129a682a6d2d841b6c429d0c51e5cb0ed1a03829d8b3d1e69a011e62cb3d3b"
1035+dependencies = [
1036+ "unicode-ident",
1037+]
1038+
1039+[[package]]
1040+name = "weezl"
1041+version = "0.1.12"
1042+source = "registry+https://github.com/rust-lang/crates.io-index"
1043+checksum = "a28ac98ddc8b9274cb41bb4d9d4d5c425b6020c50c46f25559911905610b4a88"
1044+
1045+[[package]]
1046+name = "winapi"
1047+version = "0.3.9"
1048+source = "registry+https://github.com/rust-lang/crates.io-index"
1049+checksum = "5c839a674fcd7a98952e593242ea400abe93992746761e38641405d28b00f419"
1050+dependencies = [
1051+ "winapi-i686-pc-windows-gnu",
1052+ "winapi-x86_64-pc-windows-gnu",
1053+]
1054+
1055+[[package]]
1056+name = "winapi-i686-pc-windows-gnu"
1057+version = "0.4.0"
1058+source = "registry+https://github.com/rust-lang/crates.io-index"
1059+checksum = "ac3b87c63620426dd9b991e5ce0329eff545bccbbb34f3be09ff6fb6ab51b7b6"
1060+
1061+[[package]]
1062+name = "winapi-x86_64-pc-windows-gnu"
1063+version = "0.4.0"
1064+source = "registry+https://github.com/rust-lang/crates.io-index"
1065+checksum = "712e227841d057c1ee1cd2fb22fa7e5a5461ae8e48fa2ca79ec42cfc1931183f"
1066+
1067+[[package]]
1068+name = "wit-bindgen"
1069+version = "0.51.0"
1070+source = "registry+https://github.com/rust-lang/crates.io-index"
1071+checksum = "d7249219f66ced02969388cf2bb044a09756a083d0fab1e566056b04d9fbcaa5"
1072+
1073+[[package]]
1074+name = "xml-rs"
1075+version = "0.8.28"
1076+source = "registry+https://github.com/rust-lang/crates.io-index"
1077+checksum = "3ae8337f8a065cfc972643663ea4279e04e7256de865aa66fe25cec5fb912d3f"
1078+
1079+[[package]]
1080+name = "y4m"
1081+version = "0.8.0"
1082+source = "registry+https://github.com/rust-lang/crates.io-index"
1083+checksum = "7a5a4b21e1a62b67a2970e6831bc091d7b87e119e7f9791aef9702e3bef04448"
1084+
1085+[[package]]
1086+name = "zerocopy"
1087+version = "0.8.48"
1088+source = "registry+https://github.com/rust-lang/crates.io-index"
1089+checksum = "eed437bf9d6692032087e337407a86f04cd8d6a16a37199ed57949d415bd68e9"
1090+dependencies = [
1091+ "zerocopy-derive",
1092+]
1093+
1094+[[package]]
1095+name = "zerocopy-derive"
1096+version = "0.8.48"
1097+source = "registry+https://github.com/rust-lang/crates.io-index"
1098+checksum = "70e3cd084b1788766f53af483dd21f93881ff30d7320490ec3ef7526d203bad4"
1099+dependencies = [
1100+ "proc-macro2",
1101+ "quote",
1102+ "syn",
1103+]
1104+
1105+[[package]]
1106+name = "zune-core"
1107+version = "0.5.1"
1108+source = "registry+https://github.com/rust-lang/crates.io-index"
1109+checksum = "cb8a0807f7c01457d0379ba880ba6322660448ddebc890ce29bb64da71fb40f9"
1110+
1111+[[package]]
1112+name = "zune-inflate"
1113+version = "0.2.54"
1114+source = "registry+https://github.com/rust-lang/crates.io-index"
1115+checksum = "73ab332fe2f6680068f3582b16a24f90ad7096d5d39b974d1c0aff0125116f02"
1116+dependencies = [
1117+ "simd-adler32",
1118+]
1119+
1120+[[package]]
1121+name = "zune-jpeg"
1122+version = "0.5.15"
1123+source = "registry+https://github.com/rust-lang/crates.io-index"
1124+checksum = "27bc9d5b815bc103f142aa054f561d9187d191692ec7c2d1e2b4737f8dbd7296"
1125+dependencies = [
1126+ "zune-core",
1127+]
追加 Cargo.toml
@@ -0,0 +1,8 @@
1+[package]
2+name = "opengl-render-rs"
3+version = "0.1.0"
4+edition = "2024"
5+
6+[dependencies]
7+gl = "0.14.0"
8+glfw = "0.62.0"
追加 LICENSE.md
@@ -0,0 +1,21 @@
1+# 076 Free License
2+
3+Copyright (c) 2026 テクニカル諏訪子
4+
5+Permission is hereby granted to any person obtaining a copy of the software
6+SuwaUI (the "Software") to use, modify, merge, copy, publish, distribute,
7+sublicense, and/or sell copies of the Software, subject to the following conditions:
8+
9+ 1. **Origin Attribution**:
10+ - You must not misrepresent the origin of the Software; you must not claim
11+ you created the original Software.
12+ 2. **Notice Preservation**:
13+ - This license and the above copyright notice must remain intact in all copies
14+ of the source code.
15+
16+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED,
17+INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A
18+PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
19+HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF
20+CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE
21+OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
追加 README.md
@@ -0,0 +1,7 @@
1+# Rustで書いたOpenGLレンダー
2+
3+記事:
4+* [日本語](https://technicalsuwako.moe/blog/rust-review)
5+* [English](https://technicalsuwako.moe/enblog/rust-review)
6+
7+![](https://ass.technicalsuwako.moe/rust-3.png)
追加 src/main.rs
@@ -0,0 +1,172 @@
1+extern crate glfw;
2+extern crate gl;
3+use glfw::{Action, Context, Key};
4+use gl::types::*;
5+use std::ffi::CString;
6+use std::ptr;
7+
8+const VERTEX_SRC: &str = r#"
9+#version 460 core
10+
11+layout (location = 0) in vec3 aPos;
12+
13+void main() {
14+ gl_Position = vec4(aPos.x, aPos.y, aPos.z, 1.0);
15+}
16+"#;
17+
18+const FRAG_SRC: &str = r#"
19+#version 460 core
20+
21+out vec4 FragColor;
22+
23+void main() {
24+ FragColor = vec4(1.f, .5f, .2f, 1.f);
25+}
26+"#;
27+
28+fn main() {
29+ use glfw::fail_on_errors;
30+ let mut glfw = glfw::init(glfw::fail_on_errors!()).unwrap();
31+
32+ glfw.window_hint(glfw::WindowHint::ContextVersionMajor(4));
33+ glfw.window_hint(glfw::WindowHint::ContextVersionMinor(6));
34+ glfw.window_hint(glfw::WindowHint::OpenGlProfile(glfw::OpenGlProfileHint::Core));
35+
36+ let (mut window, events) =
37+ glfw.create_window(800, 600, "OpenGLレンダー", glfw::WindowMode::Windowed)
38+ .expect("GLFWウィンドウを作成に失敗。");
39+
40+ window.make_current();
41+
42+ gl::load_with(|s| {
43+ window.get_proc_address(s)
44+ .map_or(std::ptr::null(), |f| f as *const _)
45+ });
46+
47+ window.set_key_polling(true);
48+
49+ window.set_framebuffer_size_callback(|_wnd, w, h| {
50+ unsafe { gl::Viewport(0, 0, w, h); }
51+ });
52+
53+ let mut shaderProgram = 0;
54+
55+ unsafe {
56+ let vertexShader = gl::CreateShader(gl::VERTEX_SHADER);
57+ let cVtx = CString::new(VERTEX_SRC.as_bytes())
58+ .expect("頂点シェーダー向けCStringに変換に失敗。");
59+ gl::ShaderSource(vertexShader, 1, &cVtx.as_ptr(), ptr::null());
60+ gl::CompileShader(vertexShader);
61+
62+ let mut success = gl::FALSE as GLint;
63+ gl::GetShaderiv(vertexShader, gl::COMPILE_STATUS, &mut success);
64+ if success == gl::FALSE as GLint {
65+ let mut len = 0;
66+ gl::GetShaderiv(vertexShader, gl::INFO_LOG_LENGTH, &mut len);
67+ let mut infoLog = vec![0u8; len as usize];
68+ gl::GetShaderInfoLog(vertexShader, len, ptr::null_mut(),
69+ infoLog.as_mut_ptr() as *mut GLchar);
70+ let log = String::from_utf8_lossy(&infoLog);
71+ panic!("頂点シェーダーコンパイルに失敗。\n{}", log);
72+ }
73+
74+ let fragShader = gl::CreateShader(gl::FRAGMENT_SHADER);
75+ let cFrag = CString::new(FRAG_SRC.as_bytes())
76+ .expect("フラグメントシェーダー向けCStringに変換に失敗。");
77+ gl::ShaderSource(fragShader, 1, &cFrag.as_ptr(), ptr::null());
78+ gl::CompileShader(fragShader);
79+
80+ gl::GetShaderiv(fragShader, gl::COMPILE_STATUS, &mut success);
81+ if success == gl::FALSE as GLint {
82+ let mut len = 0;
83+ gl::GetShaderiv(fragShader, gl::INFO_LOG_LENGTH, &mut len);
84+ let mut infoLog = vec![0u8; len as usize];
85+ gl::GetShaderInfoLog(fragShader, len, ptr::null_mut(),
86+ infoLog.as_mut_ptr() as *mut GLchar);
87+ let log = String::from_utf8_lossy(&infoLog);
88+ panic!("フラグメントシェーダーコンパイルに失敗。\n{}", log);
89+ }
90+
91+ shaderProgram = gl::CreateProgram();
92+ gl::AttachShader(shaderProgram, vertexShader);
93+ gl::AttachShader(shaderProgram, fragShader);
94+ gl::LinkProgram(shaderProgram);
95+
96+ gl::GetProgramiv(shaderProgram, gl::LINK_STATUS, &mut success);
97+ if success == gl::FALSE as GLint {
98+ let mut len = 0;
99+ gl::GetShaderiv(fragShader, gl::INFO_LOG_LENGTH, &mut len);
100+ let mut infoLog = vec![0u8; len as usize];
101+ gl::GetShaderInfoLog(fragShader, len, ptr::null_mut(),
102+ infoLog.as_mut_ptr() as *mut GLchar);
103+ let log = String::from_utf8_lossy(&infoLog);
104+ panic!("プログラムを受け取るに失敗。\n{}", log);
105+ }
106+
107+ gl::DeleteShader(vertexShader);
108+ gl::DeleteShader(fragShader);
109+ }
110+
111+ const VERTICES: [f32; 12] = [
112+ 0.5, 0.5, 0.0,
113+ 0.5, -0.5, 0.0,
114+ -0.5, -0.5, 0.0,
115+ -0.5, 0.5, 0.0,
116+ ];
117+
118+ const INDICES: [u32; 6] = [
119+ 0, 1, 3,
120+ 1, 2, 3,
121+ ];
122+
123+ let mut VAO = 0;
124+ let mut VBO = 0;
125+ let mut EBO = 0;
126+
127+ unsafe {
128+ gl::GenVertexArrays(1, &mut VAO);
129+ gl::GenBuffers(1, &mut VBO);
130+ gl::GenBuffers(1, &mut EBO);
131+
132+ gl::BindVertexArray(VAO);
133+
134+ gl::BindBuffer(gl::ARRAY_BUFFER, VBO);
135+ gl::BufferData(gl::ARRAY_BUFFER, std::mem::size_of_val(&VERTICES) as isize,
136+ VERTICES.as_ptr() as *const _, gl::STATIC_DRAW);
137+
138+ gl::BindBuffer(gl::ELEMENT_ARRAY_BUFFER, EBO);
139+ gl::BufferData(gl::ELEMENT_ARRAY_BUFFER, std::mem::size_of_val(&INDICES) as isize,
140+ INDICES.as_ptr() as *const _, gl::STATIC_DRAW);
141+
142+ gl::VertexAttribPointer(0, 3, gl::FLOAT, gl::FALSE,
143+ 3 * std::mem::size_of::<f32>() as GLint, std::ptr::null());
144+ gl::EnableVertexAttribArray(0);
145+
146+ gl::BindBuffer(gl::ARRAY_BUFFER, 0);
147+ gl::BindVertexArray(0);
148+ }
149+
150+ while !window.should_close() {
151+ unsafe {
152+ gl::ClearColor(0.6, 0.1, 0.6, 1.0);
153+ gl::Clear(gl::COLOR_BUFFER_BIT);
154+ gl::UseProgram(shaderProgram);
155+ gl::BindVertexArray(VAO);
156+ gl::DrawElements(gl::TRIANGLES, INDICES.len() as GLint, gl::UNSIGNED_INT,
157+ std::ptr::null());
158+ }
159+
160+ window.swap_buffers();
161+
162+ glfw.poll_events();
163+ for (_, event) in glfw::flush_messages(&events) {
164+ match event {
165+ glfw::WindowEvent::Key(Key::Q, _, Action::Press, _) => {
166+ window.set_should_close(true)
167+ },
168+ _ => {},
169+ }
170+ }
171+ }
172+}