Skip to content

Update / change "DVZ_VISUAL_IMAGE_CMAP"? #51

Answered by rossant
wolro asked this question in Q&A
Discussion options

You must be logged in to vote

A few suggestions:

  • separate the code creating the texture object, and the code generating the texture data. The texture should be created only once.
  • allocate the texture data only once (if the size is meant to be fixed during the course of the application). That means calling malloc() at the beginning of the application, and FREE() at the end. When you want to update the texture, just refill the existing buffer and call dvz_visual_data().
  • dvz_visual_texture() should be called once
  • in other words, the only things that should happen when you want to update the texture are (a) updating the tex_data buffer and (b) calling dvz_upload_texture()

If that still doesn't work, could you post the f…

Replies: 3 comments 3 replies

Comment options

You must be logged in to vote
2 replies
@wolro
Comment options

@wolro
Comment options

Answer selected by wolro
Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
1 reply
@wolro
Comment options

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants