Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

textures: check if the main loop is runing before loading texture #451

Merged
merged 5 commits into from
Feb 7, 2022

Conversation

gucio321
Copy link
Collaborator

@gucio321 gucio321 commented Feb 6, 2022

this should clearify the panic, that appears when user tries to load texture befor calling (*MasterWindow).Run

@gucio321
Copy link
Collaborator Author

gucio321 commented Feb 6, 2022

@AllenDang maybe we can also add QueueNewTextureFromRgba or something that allows user to call texture-loading stuff in main function / out of game loop? the reason is that loading texture in app-loop is a bit complicated and annoying, beacuse we need to check if the texture isn't already loaded

@codecov-commenter
Copy link

codecov-commenter commented Feb 6, 2022

Codecov Report

Merging #451 (eab3d00) into master (5af165b) will decrease coverage by 0.01%.
The diff coverage is 0.00%.

Impacted file tree graph

@@            Coverage Diff            @@
##           master    #451      +/-   ##
=========================================
- Coverage    2.91%   2.90%   -0.02%     
=========================================
  Files          30      30              
  Lines        3123    3136      +13     
=========================================
  Hits           91      91              
- Misses       3032    3045      +13     
Impacted Files Coverage Δ
Context.go 80.64% <ø> (ø)
MasterWindow.go 0.00% <0.00%> (ø)
Texture.go 0.00% <0.00%> (ø)

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 5af165b...eab3d00. Read the comment docs.

this method adds texture to load queue that is processed while running app
it allows user to call texture-loading methods inside of main
function so that he shouldn't check if texture
isn't currently loaded in app loop
@gucio321
Copy link
Collaborator Author

gucio321 commented Feb 6, 2022

well, it should work now. @AllenDang is this inside of Run loop ok? IMO it shouldn't decrease performence or sth...

@gucio321
Copy link
Collaborator Author

gucio321 commented Feb 6, 2022

or better call this texture-queue processing stuff once an lock EnqueueNewTextureFromRgba after Run() call... 🤔

@AllenDang AllenDang merged commit 4e530ec into AllenDang:master Feb 7, 2022
@gucio321 gucio321 deleted the texture-loader branch February 7, 2022 08:51
gucio321 added a commit to gucio321/giu that referenced this pull request Apr 5, 2022
…(*MasterWindow).Run

no idea why is it necessary. everything seems working.
I had to forget about removeing something in AllenDang#451

fix AllenDang#494
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants