work on ground type texture

This commit is contained in:
Tuomas Katajisto 2025-09-27 22:58:42 +03:00
parent e375dc02aa
commit 4e34dbdd4c
3 changed files with 1055 additions and 1043 deletions

View File

@ -156,11 +156,11 @@ frame :: () {
sg_begin_pass(*(sg_pass.{ action = state.pass_action_clear, swapchain = cast,force(sg_swapchain) sglue_swapchain() }));
draw_editor();
uiTex := Ui_Texture.{*gPipelines.plane.bind.images[2]};
set_shader_for_images(*uiTex);
r := GR.get_rect(500,500,300,300);
immediate_quad(.{r.x, r.y}, .{r.x + r.w, r.y}, .{r.x + r.w, r.y + r.h}, .{r.x, r.y + r.h});
set_shader_for_color();
// uiTex := Ui_Texture.{*gPipelines.plane.bind.images[2]};
// set_shader_for_images(*uiTex);
// r := GR.get_rect(500,500,300,300);
// immediate_quad(.{r.x, r.y}, .{r.x + r.w, r.y}, .{r.x + r.w, r.y + r.h}, .{r.x, r.y + r.h});
// set_shader_for_color();
if !in_editor_view then game_draw();
ui_pass();
sg_end_pass();

File diff suppressed because it is too large Load Diff

View File

@ -55,8 +55,8 @@ World :: struct {
update_image_from_ground :: (world: *World, img: *sg_image) {
materialdata : [1000*1000*4]u8;
counter : int = 0;
for x: 0..1000 {
for y: 0..1000 {
for x: 0..999 {
for y: 0..999 {
if world.ground[x][y] == .GRASS {
materialdata[counter + 0] = 0;
materialdata[counter + 1] = 255;