mirror of
https://github.com/vlang/v.git
synced 2023-08-10 21:13:21 +03:00
clean up gl
This commit is contained in:
parent
f831fd62f2
commit
d3e7738a5f
25
gl/gl.v
25
gl/gl.v
@ -1,8 +1,5 @@
|
|||||||
module gl
|
module gl
|
||||||
|
|
||||||
// #define STB_IMAGE_IMPLEMENTATION
|
|
||||||
// #include <stb_image.h>
|
|
||||||
// ///////
|
|
||||||
import const (
|
import const (
|
||||||
GL_TEXTURE_2D
|
GL_TEXTURE_2D
|
||||||
GL_TEXTURE0
|
GL_TEXTURE0
|
||||||
@ -12,27 +9,23 @@ import const (
|
|||||||
GL_DEPTH_TEST
|
GL_DEPTH_TEST
|
||||||
)
|
)
|
||||||
|
|
||||||
/*
|
#include <Cocoa/Cocoa.h>
|
||||||
type Vec3 {
|
#include <CoreGraphics/CoreGraphics.h>
|
||||||
x float
|
#include "glad.h"
|
||||||
y float
|
#include "glad.c"
|
||||||
z float
|
fn init_glad() {
|
||||||
|
ok := C.gladLoadGL()
|
||||||
|
if !ok {
|
||||||
|
os.exit('Failed to initialize glad OpenGL context')
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
type Vec2 {
|
|
||||||
x int
|
|
||||||
y int
|
|
||||||
}
|
|
||||||
*/
|
|
||||||
pub fn viewport(a int, b int, c int, d int) {
|
pub fn viewport(a int, b int, c int, d int) {
|
||||||
C.glViewport(a, b, c, d)
|
C.glViewport(a, b, c, d)
|
||||||
}
|
}
|
||||||
|
|
||||||
pub fn clear_color(r, g, b, a int) {
|
pub fn clear_color(r, g, b, a int) {
|
||||||
# glClearColor(((float)r)/255.0,((float)g)/255.0,b/255.0, a/255.0);
|
# glClearColor(((float)r)/255.0,((float)g)/255.0,b/255.0, a/255.0);
|
||||||
// println('CLEAR COLOR')
|
|
||||||
// #glClearColor(0.3f, 0.9f, 0.32f, 1.0f);
|
|
||||||
// C.glClearColor(r, g, b, a)
|
|
||||||
}
|
}
|
||||||
|
|
||||||
pub fn clear() {
|
pub fn clear() {
|
||||||
|
@ -1,7 +1,5 @@
|
|||||||
module gl
|
module gl
|
||||||
|
|
||||||
// #include <OpenGL/gl.h>
|
|
||||||
// #flag -framework OpenGL
|
|
||||||
#include "glad.h"
|
#include "glad.h"
|
||||||
#include "glad.c"
|
#include "glad.c"
|
||||||
fn init_glad() {
|
fn init_glad() {
|
||||||
|
18
gl/gl_mac.v
18
gl/gl_mac.v
@ -1,18 +0,0 @@
|
|||||||
module gl
|
|
||||||
|
|
||||||
#include <Cocoa/Cocoa.h>
|
|
||||||
#include <CoreGraphics/CoreGraphics.h>
|
|
||||||
// #include <OpenGL/gl.h>
|
|
||||||
// #flag -framework OpenGL
|
|
||||||
#include "/Users/alex/code/lang/gl/glad.h"
|
|
||||||
#include "/Users/alex/code/lang/gl/glad.c"
|
|
||||||
fn init_glad() {
|
|
||||||
println('init_glad() win')
|
|
||||||
ok := C.gladLoadGL()
|
|
||||||
// # ok= gladLoadGLLoader((GLADloadproc) glfwGetProcAddress);
|
|
||||||
if !ok {
|
|
||||||
os.exit('Failed to initialize glad OpenGL context')
|
|
||||||
}
|
|
||||||
// # printf("glClear ADDR=%p\n", glClear);
|
|
||||||
}
|
|
||||||
|
|
12
gl/gl_win.v
12
gl/gl_win.v
@ -1,12 +0,0 @@
|
|||||||
module gl
|
|
||||||
|
|
||||||
fn init_glad() {
|
|
||||||
println('init_glad() win')
|
|
||||||
ok := false
|
|
||||||
# ok= gladLoadGLLoader((GLADloadproc) glfwGetProcAddress);
|
|
||||||
if !ok {
|
|
||||||
os.exit('Failed to initialize glad OpenGL context')
|
|
||||||
}
|
|
||||||
# printf("glClear ADDR=%p\n", glClear);
|
|
||||||
}
|
|
||||||
|
|
Loading…
Reference in New Issue
Block a user