Skip to content

A fast 2D and 3D game engine — TypeScript SDK, C++/WebAssembly core, visual editor. Ship one project to web, desktop, WeChat MiniGames, playable ads, and native Android / iOS.

1.9 KB
Raw Blame
// SPDX-License-Identifier: Apache-2.0
// SPDX-FileCopyrightText: Copyright (c) 2024-present ESEngine Team
#pragma once


#include "../core/Types.hpp"

namespace esengine {

void draw_begin(uintptr_t matrixPtr, i32 viewportWidth, i32 viewportHeight);
void draw_end();
void draw_deferEnd();
void draw_line(f32 fromX, f32 fromY, f32 toX, f32 toY,
               f32 r, f32 g, f32 b, f32 a, f32 thickness);
void draw_line3D(f32 fromX, f32 fromY, f32 fromZ, f32 toX, f32 toY, f32 toZ,
                 f32 r, f32 g, f32 b, f32 a, f32 thickness);
void draw_line3DScreen(f32 fromX, f32 fromY, f32 fromZ, f32 toX, f32 toY, f32 toZ,
                       f32 r, f32 g, f32 b, f32 a, f32 thickness);
void draw_line3DScreenOffset(f32 anchorX, f32 anchorY, f32 anchorZ,
                             f32 fromX, f32 fromY, f32 toX, f32 toY,
                             f32 r, f32 g, f32 b, f32 a, f32 thickness);
void draw_rect(f32 x, f32 y, f32 width, f32 height,
               f32 r, f32 g, f32 b, f32 a, bool filled);
void draw_rectOutline(f32 x, f32 y, f32 width, f32 height,
                      f32 r, f32 g, f32 b, f32 a, f32 thickness);
void draw_circle(f32 centerX, f32 centerY, f32 radius,
                 f32 r, f32 g, f32 b, f32 a, bool filled, i32 segments);
void draw_circleOutline(f32 centerX, f32 centerY, f32 radius,
                        f32 r, f32 g, f32 b, f32 a, f32 thickness, i32 segments);
void draw_texture(f32 x, f32 y, f32 width, f32 height, u32 textureId,
                  f32 r, f32 g, f32 b, f32 a);
void draw_textureRotated(f32 x, f32 y, f32 width, f32 height, f32 rotation,
                         u32 textureId, f32 r, f32 g, f32 b, f32 a);
void draw_setLayer(i32 layer);
void draw_setDepth(f32 depth);
u32 draw_getDrawCallCount();
u32 draw_getPrimitiveCount();
void draw_setBlendMode(i32 mode);
void draw_setDepthTest(bool enabled);
u32 draw_getDepthState();
void draw_setDepthState(u32 flags);
void draw_deferBegin();

}  // namespace esengine