Skip to content
This repository has been archived by the owner on May 13, 2021. It is now read-only.

Commit

Permalink
related #5
Browse files Browse the repository at this point in the history
  • Loading branch information
kiakra committed Sep 18, 2020
1 parent e380cb7 commit c176549
Show file tree
Hide file tree
Showing 11 changed files with 5,111 additions and 166 deletions.
5 changes: 3 additions & 2 deletions examples/custombatch.zig
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
const std = @import("std");
usingnamespace @import("kiragine").kira.log;
const engine = @import("kiragine");

fn draw() !void {
Expand Down Expand Up @@ -98,10 +99,10 @@ pub fn main() !void {

try engine.open();

// Enables the non-textured custom batch,
// Enables the non-textured custom batch,
// everything should be white, if not there is a problem with custom batch and shader
try engine.enableCustomBatch2D(engine.Batch2DQuadNoTexture, &batch, shader);

try engine.update();

// Disables the non-textured custom batch
Expand Down
11 changes: 6 additions & 5 deletions examples/particlesystem.zig
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
const std = @import("std");
usingnamespace @import("kiragine").kira.log;
const engine = @import("kiragine");

const maxparticle = 1500;
Expand All @@ -11,7 +12,7 @@ const targetfps = 60;

var rand: std.rand.Xoroshiro128 = undefined;

var particlesys = ParticleSystem{
var particlesys = ParticleSystem{
.drawfn = particledraw,
};

Expand Down Expand Up @@ -55,15 +56,15 @@ fn draw() !void {
//try particlesys.draw();
// draws as rectangles
//try particlesys.drawAsRectangles();

// draws as textures(Don't forget to enable texture batch!)
// try particlesys.drawAsTextures();

// draws as triangles
//try particlesys.drawAsTriangles();

// draws as circles
try particlesys.drawAsCircles();
try particlesys.drawAsCircles();

// Pops the current batch
try engine.popBatch2D();
Expand Down
3 changes: 2 additions & 1 deletion examples/shapedraw.zig
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
const std = @import("std");
usingnamespace @import("kiragine").kira.log;
const engine = @import("kiragine");

const windowWidth = 1024;
Expand All @@ -24,7 +25,7 @@ fn draw() !void {
try engine.pushBatch2D(engine.Renderer2DBatchTag.lines);
// Draw line
try engine.drawLine(.{ .x = 400, .y = 400 }, .{ .x = 400, .y = 500 }, engine.Colour.rgba(255, 255, 255, 255));

// Draws a circle lines
try engine.drawCircleLines(.{ .x = 700, .y = 200 }, 30, engine.Colour.rgba(200, 200, 200, 255));
// Pops the current batch
Expand Down
1 change: 1 addition & 0 deletions examples/simpleshooter.zig
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
const std = @import("std");
usingnamespace @import("kiragine").kira.log;
const engine = @import("kiragine");

usingnamespace @import("kiragine").kira.log;
Expand Down
1 change: 1 addition & 0 deletions examples/textures.zig
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
const std = @import("std");
usingnamespace @import("kiragine").kira.log;
const engine = @import("kiragine");

const windowWidth = 1024;
Expand Down
4 changes: 4 additions & 0 deletions include/onefile/stb/truetype.c
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
#define STB_TRUETYPE_IMPLEMENTATION
#define STBTT_STATIC

#include "truetype.h"
Loading

0 comments on commit c176549

Please sign in to comment.