summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/main/game.c10
-rw-r--r--src/main/game.h2
-rw-r--r--src/main/main.c14
3 files changed, 23 insertions, 3 deletions
diff --git a/src/main/game.c b/src/main/game.c
index bc9e007..ea1a935 100644
--- a/src/main/game.c
+++ b/src/main/game.c
@@ -17,13 +17,21 @@
* along with Tris Game. If not, see <http://www.gnu.org/licenses/>.
*/
+#include <GL/gl.h>
+
#include "engine/engine.h"
void
-game_field(int box_size, int x, int y)
+game_draw_field(int box_size, int x, int y)
{
+ glLineWidth(5.0f);
+ glBegin(GL_LINES);
+ glColor3f(1.0f, 1.0f, 0.0f); /* Yellow */
+
engine_draw_line(box_size, y, box_size, box_size * 3);
engine_draw_line(box_size * 2, y, box_size * 2, box_size * 3);
engine_draw_line(x, box_size, box_size * 3, box_size);
engine_draw_line(x, box_size * 2, box_size * 3, box_size * 2);
+
+ glEnd();
}
diff --git a/src/main/game.h b/src/main/game.h
index a337bf8..8148645 100644
--- a/src/main/game.h
+++ b/src/main/game.h
@@ -20,6 +20,6 @@
#ifndef __GAME_H__
#define __GAME_H__
-void game_field(int box_size, int x, int y);
+void game_draw_field(int box_size, int x, int y);
#endif /* __GAME_H__ */
diff --git a/src/main/main.c b/src/main/main.c
index 76876f0..6e10477 100644
--- a/src/main/main.c
+++ b/src/main/main.c
@@ -17,15 +17,27 @@
* along with Tris Game. If not, see <http://www.gnu.org/licenses/>.
*/
+#include <GL/gl.h>
+#include <GL/glx.h>
#include <stdio.h>
#include <stdlib.h>
#include "ui/ui.h"
#include "engine/engine.h"
+#include "game.h"
#define WIDTH 640
#define HEIGHT 480
-void draw_frame() {
+void
+draw_frame()
+{
+ glClearColor(0.0f, 0.0f, 0.2f, 1.0f);
+ glClear(GL_COLOR_BUFFER_BIT);
+ glEnable(GL_LINE_SMOOTH);
+ glEnable(GL_BLEND);
+ glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA);
+
+ game_draw_field(100, 10, 10);
}
int main(void) {