hoffstadt / hoffstadt/DearPyGui

raw_texture displays incorrectly for `format=dpg.mvFormat_Float_rgb` on MacOS

Open
#966 2 comments 0 reactions 0 assignees View on GitHub
platform: MacOS type: improvement
Dominant language
C++
Stars
15.6k
Forks
783
PR merge metrics
No merged PRs in 30d

Description

## Version of Dear PyGui

Version: 0.8.0
Operating System: Mac 10.15.7

## My Issue/Question

raw_texture displays incorrect for `format=dpg.mvFormat_Float_rgb` on MacOS but correctly on Windows. I think the format constant is wrong on the Mac side for sending to the graphics system.

## Screenshots/Video

Correct windows output:
![raw_texture_win](https://user-images.githubusercontent.com/1454335/123631346-e1206500-d7d3-11eb-8ff5-5e911d849e0a.jpg)

Incorrect Mac Output:
![raw_texture_mac](https://user-images.githubusercontent.com/1454335/123631362-e7aedc80-d7d3-11eb-8d8f-4d4fc701df4e.jpg)

```python
import dearpygui.dearpygui as dpg
import numpy as np

dpg.setup_registries()

image_rgba = np.zeros((300, 300, 4), dtype=np.float32)
image_rgba[:, :, -1] = 1
image_rgba[200, :, 1] = 1

image_rgb = np.ascontiguousarray(image_rgba[:, :, :3])

with dpg.window(label="Image view test", width=1500, height=800) as win_id:

with dpg.drawlist(width=1500, height=500) as draw_id:

texture_dynamic = dpg.add_dynamic_texture(300, 300, image_rgba)
dpg.draw_image(texture_dynamic, [0, 0], [300, 300])
dpg.draw_text([0, 10], "dynamic texture RGBA - OK", size=15, color=(255, 255, 255, 255))

texture_raw = dpg.add_raw_texture(300, 300, image_rgba, format=dpg.mvFormat_Float_rgba)
dpg.draw_image(texture_raw, [310, 0], [610, 300])
dpg.draw_text([310, 10], "raw texture RGBA - OK", size=15, color=(255, 255, 255, 255))

# This shows correct on windows but incorrect on Mac.
texture_raw_rgb = dpg.add_raw_texture(300, 300, image_rgb, format=dpg.mvFormat_Float_rgb)
dpg.draw_image(texture_raw_rgb, [620, 0], [920, 300])
dpg.draw_text([620, 10], "raw texture RGB - issue on Mac", size=15, color=(255, 255, 255, 255))

dpg.start_dearpygui()
```

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.