Fixed live resizing bug with the layer based view.
This commit is contained in:
parent
0335a1a718
commit
00d8206ad2
|
@ -465,6 +465,9 @@ metal__make_buffer(u32 size, id<MTLDevice> device){
|
||||||
|
|
||||||
// NOTE(yuval): Check for a free texture slot and allocate another slot bucket if no free slot has been found
|
// NOTE(yuval): Check for a free texture slot and allocate another slot bucket if no free slot has been found
|
||||||
if (!texture_slots.first_free_slot){
|
if (!texture_slots.first_free_slot){
|
||||||
|
// NOTE(yuval): Assert that the next bucket's index can fit in a u16
|
||||||
|
Assert(texture_slots.bucket_count < ((u16)-1));
|
||||||
|
|
||||||
Metal_Texture_Slot_Bucket *bucket =
|
Metal_Texture_Slot_Bucket *bucket =
|
||||||
(Metal_Texture_Slot_Bucket*)system_memory_allocate(sizeof(Metal_Texture_Slot_Bucket) + (sizeof(Metal_Texture_Slot_Locator_Node) * metal__texture_slots_per_bucket), file_name_line_number_lit_u8);
|
(Metal_Texture_Slot_Bucket*)system_memory_allocate(sizeof(Metal_Texture_Slot_Bucket) + (sizeof(Metal_Texture_Slot_Locator_Node) * metal__texture_slots_per_bucket), file_name_line_number_lit_u8);
|
||||||
|
|
||||||
|
@ -480,7 +483,7 @@ metal__make_buffer(u32 size, id<MTLDevice> device){
|
||||||
}
|
}
|
||||||
|
|
||||||
sll_queue_push(texture_slots.first_bucket, texture_slots.last_bucket, bucket);
|
sll_queue_push(texture_slots.first_bucket, texture_slots.last_bucket, bucket);
|
||||||
++texture_slots.bucket_count;
|
texture_slots.bucket_count += 1;
|
||||||
}
|
}
|
||||||
Assert(texture_slots.first_free_slot);
|
Assert(texture_slots.first_free_slot);
|
||||||
|
|
||||||
|
|
|
@ -583,8 +583,8 @@ mac_toggle_fullscreen(void){
|
||||||
}
|
}
|
||||||
|
|
||||||
- (void)windowDidResize:(NSNotification*)notification{
|
- (void)windowDidResize:(NSNotification*)notification{
|
||||||
printf("Resize!\n");
|
|
||||||
mac_resize(mac_vars.window);
|
mac_resize(mac_vars.window);
|
||||||
|
[mac_vars.view display];
|
||||||
}
|
}
|
||||||
|
|
||||||
- (void)windowDidMiniaturize:(NSNotification*)notification{
|
- (void)windowDidMiniaturize:(NSNotification*)notification{
|
||||||
|
@ -630,8 +630,7 @@ mac_toggle_fullscreen(void){
|
||||||
mac_resize(mac_vars.window);
|
mac_resize(mac_vars.window);
|
||||||
}
|
}
|
||||||
|
|
||||||
- (BOOL)wantsUpdateLayer
|
- (BOOL)wantsUpdateLayer{
|
||||||
{
|
|
||||||
return YES;
|
return YES;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue