Skip to content

Textures not working with TSfmlVertexArray #10

@astr0wiz

Description

@astr0wiz

I have written a small FPC project which attempted to load a texture into a TVertexArray and display it, along with a couple other reference graphics. I have a TCircleShape with a texture that displays just fine and a TVertexArray with colors on the vertices which displays very well. However, the textured vertex array does not. I made sure that the VA would display without the texture very simply by removing the pointer to the Render State in the Draw command. It shows just fine with a color, but nothing is displayed with a texture. I have also played with the texture coordinates on the vertices, thinking that maybe I should define a standard rectangle instead of texture coordinates that mimic the shape of the VA.

Code and a snapshot of the running code with the reference texture file (in Gimp) are attached. Sadly, the lpr file had to be given a TXT extension in order to attach. To keep the attachments under control, I did not include the SFML dll files and the Arial font file. All the code resides in just the lpr file. I am currently using Lazarus 1.6 on a Windows 10 machine. The project is configured to be a Win64 exe and -WG is turned on.

I would really like to find out that this is just a simple coding issue, but I have been playing with this for a while, getting nowhere and finding nothing online about it. Any and all help will be greatly appreciated.

Texture:
swish

Snapshot:
ss_160923_151921

Code:
textureloadtest.lpr.txt

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions