mirror of
https://gitlab.com/raylibtemplates/rt.git
synced 2026-06-15 05:25:12 -04:00
Split Drawing into separate file
This commit is contained in:
14
src/draw.c
Normal file
14
src/draw.c
Normal file
@@ -0,0 +1,14 @@
|
|||||||
|
#include "draw.h"
|
||||||
|
#include "main.h"
|
||||||
|
#include "raylib.h"
|
||||||
|
#include "raymath.h"
|
||||||
|
|
||||||
|
void Draw() {
|
||||||
|
ClearBackground(BLACK);
|
||||||
|
DrawCircleV((Vector2){160.0f, 120.0f}, 120.0f, WHITE);
|
||||||
|
BeginMode3D(cam);
|
||||||
|
{
|
||||||
|
DrawModel(cube, Vector3Zero(), 1.0f, WHITE);
|
||||||
|
}
|
||||||
|
EndMode3D();
|
||||||
|
}
|
||||||
1
src/draw.h
Normal file
1
src/draw.h
Normal file
@@ -0,0 +1 @@
|
|||||||
|
extern void Draw();
|
||||||
12
src/main.c
12
src/main.c
@@ -1,5 +1,6 @@
|
|||||||
#include "main.h"
|
#include "main.h"
|
||||||
#include "consts.h"
|
#include "consts.h"
|
||||||
|
#include "draw.h"
|
||||||
#include "raylib.h"
|
#include "raylib.h"
|
||||||
#include "raymath.h"
|
#include "raymath.h"
|
||||||
#include "update.h"
|
#include "update.h"
|
||||||
@@ -15,7 +16,6 @@
|
|||||||
#define MIN(a, b) ((a) < (b) ? (a) : (b))
|
#define MIN(a, b) ((a) < (b) ? (a) : (b))
|
||||||
|
|
||||||
static void MainLoop();
|
static void MainLoop();
|
||||||
static void Draw();
|
|
||||||
|
|
||||||
RenderTexture2D target;
|
RenderTexture2D target;
|
||||||
|
|
||||||
@@ -84,13 +84,3 @@ static void MainLoop() {
|
|||||||
}
|
}
|
||||||
EndDrawing();
|
EndDrawing();
|
||||||
}
|
}
|
||||||
|
|
||||||
static void Draw() {
|
|
||||||
ClearBackground(BLACK);
|
|
||||||
DrawCircleV((Vector2){160.0f, 120.0f}, 120.0f, WHITE);
|
|
||||||
BeginMode3D(cam);
|
|
||||||
{
|
|
||||||
DrawModel(cube, Vector3Zero(), 1.0f, WHITE);
|
|
||||||
}
|
|
||||||
EndMode3D();
|
|
||||||
}
|
|
||||||
|
|||||||
Reference in New Issue
Block a user