Skip to content

Commit

Permalink
bump submodules
Browse files Browse the repository at this point in the history
Signed-off-by: Marek Maškarinec <[email protected]>
  • Loading branch information
marekmaskarinec committed Aug 19, 2024
1 parent 1be921f commit d07ca1c
Show file tree
Hide file tree
Showing 5 changed files with 6 additions and 315 deletions.
2 changes: 1 addition & 1 deletion lib/stb
2 changes: 1 addition & 1 deletion lib/umka
313 changes: 2 additions & 311 deletions src/staembed.c
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#include "tophat.h"
#include "tophat.h"
const char *th_em_modulesrc[] = {
"\n"
"import (\n"
Expand Down Expand Up @@ -515,7 +515,7 @@ const char *th_em_modulesrc[] = {
"}\n"
"\n"
"fn umth_image_render_target_begin(rt: RenderTarget): th::ErrCode\n"
"//~~fn RenderTarget.end\n"
"//~~fn RenderTarget.begin\n"
"// Begins the render target rendering pass.\n"
"fn (rt: ^RenderTarget) begin*(): std::Err {\n"
"//~~\n"
Expand Down Expand Up @@ -4389,227 +4389,6 @@ const char *th_em_moduledocs[] = {
"---------\n"
"\n"
"",
"opaque Image\n"
"\n"
"type Image* = struct{ _: ^struct{} }\n"
"\n"
"Represents a drawable image. It is an opaque structure.\n"
"Images support a color filter. It is applied by multiplying the color\n"
"of each pixel with the filter.\n"
"\n"
"---------\n"
"\n"
"opaque RenderTarget\n"
"\n"
"type RenderTarget* = struct { _: ^struct{} }\n"
"\n"
"An image you can render to.\n"
"\n"
"---------\n"
"\n"
"fn createRenderTarget\n"
"\n"
"fn createRenderTarget*(size: th::Vf2, filter: int): (RenderTarget, std::Err) {\n"
"\n"
"Creates a render target you can draw to, like to a window.\n"
"Filter specifies specfifies filtering for resulting image.\n"
"Image can be retrieved via `toImage`.\n"
"\n"
"---------\n"
"\n"
"fn RenderTarget.end\n"
"\n"
"fn (rt: ^RenderTarget) begin*(): std::Err {\n"
"\n"
"Begins the render target rendering pass.\n"
"\n"
"---------\n"
"\n"
"fn RenderTarget.end\n"
"\n"
"fn (rt: ^RenderTarget) end*(wp: th::Vf2): std::Err {\n"
"\n"
"Ends the render target rendering pass.\n"
"\n"
"---------\n"
"\n"
"fn RenderTarget.toImage\n"
"\n"
"fn (rt: ^RenderTarget) toImage*(): Image {\n"
"\n"
"Returns the image of the render target. The resulting image has the same\n"
"lifetime as the base RenderTarget. If you need to use it past the lifetime\n"
"of the RenderTarget, use the copy method.\n"
"Do not call `setfilter` on the resulting image.\n"
"\n"
"---------\n"
"\n"
"fn load\n"
"\n"
"fn load*(path: str): (Image, std::Err) {\n"
"\n"
"Loads an image at path.\n"
"\n"
"---------\n"
"\n"
"fn Image.validate\n"
"\n"
"fn (i: ^Image) validate*(): bool {\n"
"\n"
"Returns true, if i\'s handle points to an image.\n"
"\n"
"---------\n"
"\n"
"fn Image.flipv\n"
"\n"
"fn (i: ^Image) flipv*(flip: bool) {\n"
"\n"
"Flips image on it\'s vertical axis.\n"
"\n"
"---------\n"
"\n"
"fn Image.fliph\n"
"\n"
"fn (i: ^Image) fliph*(flip: bool) {\n"
"\n"
"Flips image on it\'s horizontal axis.\n"
"\n"
"---------\n"
"\n"
"fn Image.draw\n"
"\n"
"fn (i: ^Image) draw*(t: th::Transform, color: uint32 = th::white) {\n"
"\n"
"Draws the image in screen coordinates. It transforms it with t and\n"
"applies color as a color filter.\n"
"\n"
"---------\n"
"\n"
"fn Image.blit\n"
"\n"
"fn (i: ^Image) blit*(src, dest: rect::Rect, color: uint32 = 0xFFFFFFFF, rot: th::fu = 0, origin: th::Vf2 = {0, 0}) {\n"
"\n"
"Copies source rectangle (texture coordinates) to destination rectangle (screen coordinates).\n"
"\n"
"---------\n"
"\n"
"fn Image.drawNinepatch\n"
"\n"
"fn (i: ^Image) drawNinepatch*(outer, inner, dest: rect::Rect, color: uint32 = th::white, scale: real = 1.0) {\n"
"\n"
"Draws \"nine-patch\" image.\n"
"`outer` specifies the texture coordinates of the outer rect of source image,\n"
"`inner` specifies coordinates of inner rect of source image, positioned relative to `outer`.\n"
"You can tint with `color`.\n"
"\n"
"![](img/ninepatch.png)\n"
"\n"
"---------\n"
"\n"
"fn Image.drawOnQuad\n"
"\n"
"fn (i: ^Image) drawOnQuad*(q: th::Quad, color: uint32 = th::white) {\n"
"\n"
"Draws the image on top of a quad with corners of the image positioned\n"
"on the verticies of the quad.\n"
"\n"
"---------\n"
"\n"
"fn Image.getDims\n"
"\n"
"fn (i: ^Image) getDims*(): th::Vf2 {\n"
"\n"
"Returns width and heigth.\n"
"\n"
"---------\n"
"\n"
"fn Image.crop\n"
"\n"
"fn (i: ^Image) crop*(tl, br: th::Vf2) {\n"
"\n"
"Crops an image. Coordinates are between 0, 0 (top left) and\n"
"1, 1 (bottom right)\n"
"\n"
"---------\n"
"\n"
"fn Image.cropPx\n"
"\n"
"fn (i: ^Image) cropPx*(tr, br: th::Vf2) {\n"
"\n"
"Same as `Image.crop`, but the positions are in pixels.\n"
"\n"
"---------\n"
"\n"
"fn Image.cropRect\n"
"\n"
"fn (i: ^Image) cropRect*(r: rect::Rect) {\n"
"\n"
"Same as `Image.crop`, but uses a rect instead of two positions.\n"
"\n"
"---------\n"
"\n"
"fn Image.cropQuad\n"
"\n"
"fn (i: ^Image) cropQuad*(q: th::Quad) {\n"
"\n"
"Crop an image using a quad.\n"
"\n"
"---------\n"
"\n"
"fn Image.getCropQuad\n"
"\n"
"fn (i: ^Image) getCropQuad*(): th::Quad {\n"
"\n"
"Crop an image using a quad.\n"
"\n"
"---------\n"
"\n"
"fn mk\n"
"\n"
"fn mk*(data: []uint32, dm: th::Vf2): (Image, std::Err) {\n"
"\n"
"Creates an image from raw data.\n"
"\n"
"---------\n"
"\n"
"fn Image.copy\n"
"\n"
"fn (i: ^Image) copy*(): (Image, std::Err) {\n"
"\n"
"Copies image into a new one.\n"
"\n"
"---------\n"
"\n"
"fn Image.setfilter\n"
"\n"
"fn (i: ^Image) setfilter*(filter: int): std::Err {\n"
"\n"
"Sets a mag/min filter. 0 is nearest, others are linear.\n"
"This function will regenerate the texture. This means it shouldn\'t be\n"
"used in a loop.\n"
"https://learnopengl.com/img/getting-started/texture_filtering.png\n"
"left is nearest, right is linear.\n"
"\n"
"---------\n"
"\n"
"fn Image.setData\n"
"\n"
"fn (i: ^Image) setData*(data: []uint32, dm: th::Vf2): std::Err {\n"
"\n"
"Updates the image data. dm are the dimensions of the new image.\n"
"The new image doesn\'t have to be the same size as the old one.\n"
"\n"
"---------\n"
"\n"
"fn Image.getData\n"
"\n"
"fn (i: ^Image) getData*(): []uint32 {\n"
"\n"
"Gets the image data. This downloads the data from the GPU on **each call**.\n"
"Don\'t use in performance critical sections.\n"
"\n"
"---------\n"
"\n"
"",
"\n"
"\n"
Expand Down Expand Up @@ -5017,94 +4796,6 @@ const char *th_em_moduledocs[] = {
"---------\n"
"\n"
"",
"\n"
"\n"
"\n"
"Canvas library allowing for drawing basic shapes. Coordinates are based on\n"
"the screen.\n"
"\n"
"---------\n"
"\n"
"fn drawText\n"
"\n"
"fn drawText*(text: str, pos: th::Vf2, color: uint32, size: th::fu) {\n"
"\n"
"Draws a basic pixel text. Only ascii is supported.\n"
"\n"
"---------\n"
"\n"
"fn textSize\n"
"\n"
"fn textSize*(text: str, scale: th::fu): th::Vf2 {\n"
"\n"
"Returns the size of text taken by an equivalent drawText call.\n"
"\n"
"---------\n"
"\n"
"Pixel Font\n"
"\n"
"var pixelFont*: PixelFont\n"
"\n"
"The `pixelFont` variable exposes the canvas pixel font as a generic font.\n"
"\n"
"---------\n"
"\n"
"fn drawRect\n"
"\n"
"fn drawRect*(color: uint32, r: rect::Rect) {\n"
"\n"
"Draws a Rectangle.\n"
"\n"
"---------\n"
"\n"
"fn drawLine\n"
"\n"
"fn drawLine*(color: uint32, b, e: th::Vf2, thickness: th::fu) {\n"
"\n"
"Draws a line.\n"
"\n"
"---------\n"
"\n"
"fn drawRectLines\n"
"\n"
"fn drawRectLines*(color: uint32, r: rect::Rect, thickness: real32 = 1.0) {\n"
"\n"
"Draws rect border.\n"
"\n"
"---------\n"
"\n"
"fn drawQuad\n"
"\n"
"fn drawQuad*(color: uint32, q: th::Quad) {\n"
"\n"
"Draws a convex quad.\n"
"\n"
"---------\n"
"\n"
"fn drawTrig\n"
"\n"
"fn drawTrig*(color: uint32, a, b, c: th::Vf2) {\n"
"\n"
"Draws a triangle.\n"
"\n"
"---------\n"
"\n"
"fn beginScissorRect\n"
"\n"
"fn beginScissorRect*(r: rect::Rect, debug: bool = false) {\n"
"\n"
"Disable rendering outside of rect `r`\n"
"\n"
"---------\n"
"\n"
"fn endScissor\n"
"\n"
"fn endScissor*() {\n"
"\n"
"Stops cropping\n"
"\n"
"---------\n"
"\n"
"",
"struct Rect\n"
"\n"
Expand Down

0 comments on commit d07ca1c

Please sign in to comment.