Skip to content

Texture.Update(Texture, uint, uint) not found? #223

@hawkerm

Description

@hawkerm

Tried to use the Texture.Update method to update from another texture, but got a C++ exception about missing entry point:

Exception thrown: 'System.EntryPointNotFoundException' in SFML.Graphics.dll
An unhandled exception of type 'System.EntryPointNotFoundException' occurred in SFML.Graphics.dll
Unable to find an entry point named 'sfTexture_updateFromTexture' in DLL 'csfml-graphics'.

public void Update(Texture texture, uint x, uint y)
{
sfTexture_updateFromTexture(CPointer, texture.CPointer, x, y);
}

(Also looks like the overload without the x, y values and just taking the Texture directly is missing?)

image

Using NuGet package 2.5.0.

Code:

RenderTexture buff1 = new(800, 600);
Texture buff2 = new(800, 600);

// ... Draw stuff to buff1 ...

buff2.Update(buff1.Texture, 0, 0); // Fails

I was creating a whole new Texture each time before (which works), but is eating memory and causing issues with Garbage Collection:

Sprite buff2Sprite = new();

buff2Sprite.Texture = new Texture(buff1.Texture);

Is there some other way I should be doing this operation?

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions