mirror of
https://github.com/griffi-gh/hUI.git
synced 2024-11-21 22:58:42 -06:00
stuff
This commit is contained in:
parent
a92817cb88
commit
f25efdb3ca
|
@ -9,11 +9,5 @@ in vec2 vtx_uv;
|
|||
uniform sampler2D tex;
|
||||
|
||||
void main() {
|
||||
//HACK: if vtx_uv is (0, 0) then the texture is not used
|
||||
//disabling this will cause blinking
|
||||
if (vtx_uv.x == 0.0 && vtx_uv.y == 0.0) {
|
||||
out_color = vtx_color;
|
||||
return;
|
||||
}
|
||||
out_color = texture(tex, vtx_uv) * vtx_color;
|
||||
}
|
||||
|
|
|
@ -165,6 +165,7 @@ impl UiDrawCall {
|
|||
.map(|x| atlas.get_uv(x))
|
||||
.flatten()
|
||||
.unwrap_or(Corners::all(Vec2::ZERO));
|
||||
|
||||
let vidx = draw_call.vertices.len() as u32;
|
||||
if let Some(corner) = rounded_corners.filter(|x| x.radius.max_f32() > 0.0) {
|
||||
//this code is stupid as fuck
|
||||
|
|
|
@ -219,6 +219,14 @@ impl TextureAtlasManager {
|
|||
}
|
||||
}
|
||||
|
||||
pub(crate) fn add_dummy(&mut self) {
|
||||
let handle = self.allocate((1, 1).into());
|
||||
assert!(handle.index == 0, "Dummy texture handle is not 0");
|
||||
assert!(self.get(handle).unwrap().position == (0, 0).into(), "Dummy texture position is not (0, 0)");
|
||||
self.data[0..4].copy_from_slice(&[255, 255, 255, 255]);
|
||||
self.modified = true;
|
||||
}
|
||||
|
||||
pub fn modify(&mut self, handle: ImageHandle) {
|
||||
todo!()
|
||||
}
|
||||
|
|
|
@ -43,8 +43,7 @@ impl UiInstance {
|
|||
text_renderer: TextRenderer::new(),
|
||||
atlas: {
|
||||
let mut atlas = TextureAtlasManager::default();
|
||||
//HACK: Ensure that vec(0, 0) uv is white square
|
||||
atlas.add_rgba(1, &[255, 255, 255, 255]);
|
||||
atlas.add_dummy();
|
||||
atlas
|
||||
},
|
||||
events: EventQueue::new(),
|
||||
|
|
Loading…
Reference in a new issue