@@ -434,10 +434,10 @@ void LunarWM_run(LunarWM *wm)
|
||||
wlr_log(WLR_ERROR, "Failed to end OpenXR frame");
|
||||
return;
|
||||
}
|
||||
|
||||
EndDrawing();
|
||||
} else {
|
||||
wm->renderer.camera.fovy = 75;
|
||||
}
|
||||
|
||||
EndDrawing();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -650,7 +650,7 @@ static void surface_compose_draw(
|
||||
.id = (unsigned int)attribs.tex,
|
||||
.width = (int)wlr_tex->width,
|
||||
.height = (int)wlr_tex->height,
|
||||
.mipmaps = 0,
|
||||
.mipmaps = 1,
|
||||
.format = PIXELFORMAT_UNCOMPRESSED_R8G8B8A8,
|
||||
};
|
||||
|
||||
@@ -681,22 +681,21 @@ static void surface_compose_draw(
|
||||
}
|
||||
} else {
|
||||
assert(attribs.target == GL_TEXTURE_2D);
|
||||
DrawTexturePro(tex, src, dst, (Vector2) { 0.0f, 0.0f }, 0.0f, WHITE);
|
||||
|
||||
DrawTexture(tex, sx, sy, WHITE);
|
||||
}
|
||||
}
|
||||
|
||||
bool LunarWM_Toplevel_update(LunarWM_Toplevel *this)
|
||||
{
|
||||
auto texture = wlr_surface_get_texture(this->surface);
|
||||
if (!texture)
|
||||
return false;
|
||||
|
||||
int width = this->surface->current.width;
|
||||
int height = this->surface->current.height;
|
||||
bool const size_changed = !IsRenderTextureValid(this->surface_rt)
|
||||
|| this->surface_rt.texture.width != texture->width
|
||||
|| this->surface_rt.texture.height != texture->height;
|
||||
|| this->surface_rt.texture.width != width
|
||||
|| this->surface_rt.texture.height != height;
|
||||
if (size_changed) {
|
||||
LunarWM_Toplevel_release_surface_rt(this);
|
||||
this->surface_rt = LoadRenderTexture(texture->width, texture->height);
|
||||
this->surface_rt = LoadRenderTexture(width, height);
|
||||
if (!IsRenderTextureValid(this->surface_rt)) {
|
||||
return true;
|
||||
}
|
||||
@@ -708,7 +707,7 @@ bool LunarWM_Toplevel_update(LunarWM_Toplevel *this)
|
||||
BeginTextureMode(this->surface_rt);
|
||||
ClearBackground(BLANK);
|
||||
struct SurfaceComposeCtx ctx = {
|
||||
.size = (Vector2) { texture->width, texture->height },
|
||||
.size = (Vector2) { width, height },
|
||||
.wm = this->server,
|
||||
};
|
||||
// DrawRectangle(0, 0, this->surface_rt.texture.width,
|
||||
@@ -1651,6 +1650,8 @@ static void handle_output_frame(struct wl_listener *listener, void *data)
|
||||
wlr_render_pass_submit(pass);
|
||||
wlr_output_commit_state(wlr_output, &state);
|
||||
wlr_output_state_finish(&state);
|
||||
|
||||
EndDrawing();
|
||||
}
|
||||
|
||||
static void handle_new_output(struct wl_listener *listener, void *data)
|
||||
|
||||
Reference in New Issue
Block a user