Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
W
wolf3d
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
PocketInsanity
wolf3d
Commits
7af3c59d
Commit
7af3c59d
authored
May 04, 2000
by
Steven Fuller
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Still broken opengl
parent
fd5b7acd
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
62 additions
and
3 deletions
+62
-3
vi_ogl.c
src/vi_ogl.c
+62
-2
wl_draw.c
src/wl_draw.c
+0
-1
No files found.
src/vi_ogl.c
View file @
7af3c59d
...
@@ -553,6 +553,53 @@ void DrawVisibleSprites()
...
@@ -553,6 +553,53 @@ void DrawVisibleSprites()
}
}
}
}
#define LEFTWALL 0x01
#define RIGHTWALL 0x02
#define TOPWALL 0x04
#define BOTTOMWALL 0x08
void
DrawCubex
(
byte
dat
,
GLfloat
x
,
GLfloat
y
)
{
float
x1
=
x
+
1
;
float
x2
=
x
-
1
;
float
z1
=
-
y
+
1
;
float
z2
=
-
y
-
1
;
glBegin
(
GL_QUADS
);
if
(
dat
&
BOTTOMWALL
)
{
/* glColor3f(1.0f, 0.0f, 0.0f); */
glTexCoord2d
(
1
.
0
,
0
.
0
);
glVertex3f
(
x1
,
-
1
.
0
f
,
z2
);
glTexCoord2d
(
1
.
0
,
1
.
0
);
glVertex3f
(
x2
,
-
1
.
0
f
,
z2
);
glTexCoord2d
(
0
.
0
,
1
.
0
);
glVertex3f
(
x2
,
1
.
0
f
,
z2
);
glTexCoord2d
(
0
.
0
,
0
.
0
);
glVertex3f
(
x1
,
1
.
0
f
,
z2
);
}
if
(
dat
&
TOPWALL
)
{
/* glColor3f(0.0f, 1.0f, 0.0f); */
glTexCoord2d
(
1
.
0
,
0
.
0
);
glVertex3f
(
x2
,
-
1
.
0
f
,
z1
);
glTexCoord2d
(
1
.
0
,
1
.
0
);
glVertex3f
(
x1
,
-
1
.
0
f
,
z1
);
glTexCoord2d
(
0
.
0
,
1
.
0
);
glVertex3f
(
x1
,
1
.
0
f
,
z1
);
glTexCoord2d
(
0
.
0
,
0
.
0
);
glVertex3f
(
x2
,
1
.
0
f
,
z1
);
}
if
(
dat
&
LEFTWALL
)
{
/* glColor3f(0.0f, 0.0f, 1.0f); */
glTexCoord2d
(
1
.
0
,
0
.
0
);
glVertex3f
(
x2
,
-
1
.
0
f
,
z2
);
glTexCoord2d
(
1
.
0
,
1
.
0
);
glVertex3f
(
x2
,
-
1
.
0
f
,
z1
);
glTexCoord2d
(
0
.
0
,
1
.
0
);
glVertex3f
(
x2
,
1
.
0
f
,
z1
);
glTexCoord2d
(
0
.
0
,
0
.
0
);
glVertex3f
(
x2
,
1
.
0
f
,
z2
);
}
if
(
dat
&
RIGHTWALL
)
{
/* glColor3f(1.0f, 1.0f, 0.0f); */
glTexCoord2d
(
1
.
0
,
0
.
0
);
glVertex3f
(
x1
,
-
1
.
0
f
,
z1
);
glTexCoord2d
(
1
.
0
,
1
.
0
);
glVertex3f
(
x1
,
-
1
.
0
f
,
z2
);
glTexCoord2d
(
0
.
0
,
1
.
0
);
glVertex3f
(
x1
,
1
.
0
f
,
z2
);
glTexCoord2d
(
0
.
0
,
0
.
0
);
glVertex3f
(
x1
,
1
.
0
f
,
z1
);
}
glEnd
();
}
void
DrawWalls
()
void
DrawWalls
()
{
{
int
x
,
y
;
int
x
,
y
;
...
@@ -563,6 +610,7 @@ void DrawWalls()
...
@@ -563,6 +610,7 @@ void DrawWalls()
tilehit
=
tilemap
[
x
][
y
];
tilehit
=
tilemap
[
x
][
y
];
if
(
tilehit
<
64
)
{
if
(
tilehit
<
64
)
{
glBindTexture
(
GL_TEXTURE_2D
,
waltex
[
0
]);
glBindTexture
(
GL_TEXTURE_2D
,
waltex
[
0
]);
DrawCubex
(
0xFF
,
(
GLfloat
)
x
+
.
5
,
(
GLfloat
)
y
+
.
5
);
}
}
}
}
}
}
...
@@ -689,19 +737,30 @@ void ThreeDRefresh()
...
@@ -689,19 +737,30 @@ void ThreeDRefresh()
glMatrixMode
(
GL_PROJECTION
);
glMatrixMode
(
GL_PROJECTION
);
glLoadIdentity
();
glLoadIdentity
();
DrawPlayerWeapon
();
/* draw player's hands */
//
DrawPlayerWeapon(); /* draw player's hands */
glFrustum
(
-
0
.
286751
,
0
.
286751
,
-
0
.
288675
,
0
.
288675
,
0
.
500000
,
182
.
000000
);
glFrustum
(
-
0
.
286751
,
0
.
286751
,
-
0
.
288675
,
0
.
288675
,
0
.
500000
,
182
.
000000
);
glMatrixMode
(
GL_MODELVIEW
);
glMatrixMode
(
GL_MODELVIEW
);
glRotatef
(
player
->
angle
,
0
.
0
f
,
1
.
0
f
,
0
.
0
f
);
glRotatef
(
player
->
angle
,
0
.
0
f
,
1
.
0
f
,
0
.
0
f
);
//printf("%f, %f\n", (GLfloat)player->x / 65536.0f, (GLfloat)player->y / 65536.0f);
glTranslatef
((
GLfloat
)
player
->
x
/
65536
.
0
f
,
0
,
(
GLfloat
)
player
->
y
/
65536
.
0
f
);
glTranslatef
((
GLfloat
)
player
->
x
/
65536
.
0
f
,
0
,
(
GLfloat
)
player
->
y
/
65536
.
0
f
);
/* Render World */
/* Render World */
DrawWalls
();
godmode
=
1
;
/* (: */
godmode
=
1
;
/* (: */
glRotatef
(
360
-
player
->
angle
,
0
.
0
f
,
1
.
0
f
,
0
.
0
f
);
glRotatef
(
360
-
player
->
angle
,
0
.
0
f
,
1
.
0
f
,
0
.
0
f
);
/* Render Sprites */
/* Render Sprites */
DrawVisibleSprites
();
DrawVisibleSprites
();
glDisable
(
GL_DEPTH_TEST
);
glMatrixMode
(
GL_MODELVIEW
);
/* temp debug */
glLoadIdentity
();
glMatrixMode
(
GL_PROJECTION
);
glLoadIdentity
();
DrawPlayerWeapon
();
/* draw player's hands */
glEnable
(
GL_DEPTH_TEST
);
//
//
// show screen and time last cycle
// show screen and time last cycle
//
//
...
@@ -715,6 +774,7 @@ void ThreeDRefresh()
...
@@ -715,6 +774,7 @@ void ThreeDRefresh()
}
}
VW_UpdateScreen
();
VW_UpdateScreen
();
VW_WaitVBL
(
1
);
frameon
++
;
frameon
++
;
}
}
...
...
src/wl_draw.c
View file @
7af3c59d
...
@@ -646,7 +646,6 @@ void ThreeDRefresh()
...
@@ -646,7 +646,6 @@ void ThreeDRefresh()
}
}
VW_UpdateScreen
();
VW_UpdateScreen
();
frameon
++
;
frameon
++
;
}
}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment