Texturemapping wrap with Drawprimitives() ?

About Monkey 2 Forums Monkey 2 Programming Help Texturemapping wrap with Drawprimitives() ?

This topic contains 2 replies, has 2 voices, and was last updated by  Diffrenzy 2 years ago.

Viewing 3 posts - 1 through 3 (of 3 total)
  • Author
    Posts
  • #7759

    Diffrenzy
    Keymaster

    How do I set  the TextureFlags on an Image?

    Specifically, I want to make my texture wrap, when using DrawPrimitives()

    I know it’s in there… 🙂 :

    #7764

    sicilica
    Participant

    You should be able to do something like this (slightly modified from Image.Load). Dunno why it doesn’t accept flags for wrap in the first place. Most of the other possible flags aren’t useful in the case of just dealing with the high-level Image class instead of writing your own rendering code, I suppose.

    Anyway, if you make an image like that, you should be able to use it with DrawPrimitives. I didn’t test any of that though, so sorry if it throws any complex errors.

    EDIT: I guess to clarify – an Image is a wrapper around an internal Texture, which is normally created when you create the Image. The flags that would make your texture wrap need to be passed in at the time when you create that Texture. Since you’re probably loading your Image from file, you unfortunately don’t have a way to pass flags like that in normally. This code handles that for you.

    #7875

    Diffrenzy
    Keymaster

    Perfect! Thanks sicilica, works at advertised 🙂

    Mark: is it possiple to add a way to just set the flag at runtime, after loading?
    myimg.Textureflags(n,flags) or something…

    OR maybe specifying them when calling DrawPrimitives()?

    Here is your sicilicas function changed to CreateImage, if someone needs it:

     

Viewing 3 posts - 1 through 3 (of 3 total)

You must be logged in to reply to this topic.