Skip to content

Commit

Permalink
misc changes + crosshair temp
Browse files Browse the repository at this point in the history
  • Loading branch information
gabekz committed Jul 28, 2023
1 parent 9450045 commit 494381f
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 8 deletions.
10 changes: 6 additions & 4 deletions res/shaders/canvas2d.shader
Original file line number Diff line number Diff line change
Expand Up @@ -29,16 +29,18 @@ layout(binding = 0) uniform sampler2D t_Texture;

uniform bool u_using_texture = false;

out vec4 color;
uniform vec4 u_color = vec4(1);
out vec4 out_color;

in VS_OUT { vec2 texCoords; }
fs_in;

void
main()
{
vec4 pixel =
(u_using_texture) ? texture(t_Texture, fs_in.texCoords) : vec4(1);
vec4 pixel = (u_using_texture)
? texture(t_Texture, fs_in.texCoords) * u_color
: u_color;

color = pixel;
out_color = pixel;
}
Binary file added res/textures/gizmo/crosshair.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
1 change: 1 addition & 0 deletions scripts/build.ps1
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
& 'C:\Program Files\CMake\bin\cmake.exe' -S . -B build/ -G "Visual Studio 16 2019" -DCMAKE_TOOLCHAIN_FILE=D:/vcpkg/scripts/buildsystems/vcpkg.cmake
8 changes: 4 additions & 4 deletions src/core/graphics/renderer/v1/renderer.c
Original file line number Diff line number Diff line change
Expand Up @@ -96,14 +96,14 @@ renderer_init()

// GUI test
Texture *guiTexture =
texture_create("../res/textures//gizmo/heart.png",
texture_create("../res/textures/gizmo/crosshair2.png",
NULL,
(TextureOptions) {1, GL_RGBA, false, true});
ret->uiImage =
gui_element_create((vec2) {25, 80}, (vec2) {50, 50}, guiTexture, NULL);
ret->uiImage = gui_element_create(
(vec2) {1920 / 2, 1080 / 2}, (vec2) {10, 10}, guiTexture, NULL);

// Test GUI Text
ret->uiText = gui_text_create("Hello, world!");
ret->uiText = gui_text_create("Goodsack");

return ret;
}
Expand Down

0 comments on commit 494381f

Please sign in to comment.