33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
|
# File 'lib/bg_utils.rb', line 33
def gen_list
@display_list = glGenLists(1)
glNewList(@display_list, GL_COMPILE)
glDepthMask(GL_FALSE)
tex = switch_texture(:z_neg)
glBegin(GL_QUADS)
glTexCoord2d(tex.left, tex.top); glVertex3f(-1, 1, -1)
glTexCoord2d(tex.left, tex.bottom); glVertex3f(-1, -1, -1)
glTexCoord2d(tex.right, tex.bottom); glVertex3f(1, -1, -1)
glTexCoord2d(tex.right, tex.top); glVertex3f(1, 1, -1)
glEnd
tex = switch_texture(:z_pos)
glBindTexture(GL_TEXTURE_2D, tex.tex_name)
glBegin(GL_QUADS)
glTexCoord2d(tex.left, tex.top); glVertex3f(1, 1, 1)
glTexCoord2d(tex.left, tex.bottom); glVertex3f(1, -1, 1)
glTexCoord2d(tex.right, tex.bottom); glVertex3f(-1, -1, 1)
glTexCoord2d(tex.right, tex.top); glVertex3f(-1, 1, 1)
glEnd
tex = switch_texture(:x_neg)
glBindTexture(GL_TEXTURE_2D, tex.tex_name)
glBegin(GL_QUADS)
glTexCoord2d(tex.left, tex.top); glVertex3f(-1, 1, 1)
glTexCoord2d(tex.left, tex.bottom); glVertex3f(-1, -1, 1)
glTexCoord2d(tex.right, tex.bottom); glVertex3f(-1, -1, -1)
glTexCoord2d(tex.right, tex.top); glVertex3f(-1, 1, -1)
glEnd
tex = switch_texture(:x_pos)
glBindTexture(GL_TEXTURE_2D, tex.tex_name)
glBegin(GL_QUADS)
glTexCoord2d(tex.left, tex.top); glVertex3f(1, 1, -1)
glTexCoord2d(tex.left, tex.bottom); glVertex3f(1, -1, -1)
glTexCoord2d(tex.right, tex.bottom); glVertex3f(1, -1, 1)
glTexCoord2d(tex.right, tex.top); glVertex3f(1, 1, 1)
glEnd
tex = switch_texture(:y_pos)
glBindTexture(GL_TEXTURE_2D, tex.tex_name)
glBegin(GL_QUADS)
glTexCoord2d(tex.left, tex.top); glVertex3f(-1, 1, 1)
glTexCoord2d(tex.left, tex.bottom); glVertex3f(-1, 1, -1)
glTexCoord2d(tex.right, tex.bottom); glVertex3f(1, 1, -1)
glTexCoord2d(tex.right, tex.top); glVertex3f(1, 1, 1)
glEnd
tex = switch_texture(:y_neg)
glBindTexture(GL_TEXTURE_2D, tex.tex_name)
glBegin(GL_QUADS)
glTexCoord2d(tex.left, tex.top); glVertex3f(-1, -1, -1)
glTexCoord2d(tex.left, tex.bottom); glVertex3f(-1, -1, 1)
glTexCoord2d(tex.right, tex.bottom); glVertex3f(1, -1, 1)
glTexCoord2d(tex.right, tex.top); glVertex3f(1, -1, -1)
glEnd
glDepthMask(GL_TRUE)
glEndList
end
|