Git Product home page Git Product logo

Comments (3)

rlabrecque avatar rlabrecque commented on September 13, 2024

Yeah, I would first recommend updating to the latest master branch version of Steamworks.NET where string has already been changed to IntPtr.

Valve really should have made it uint8 * or something like that instead of const char *.

In my testing I've been doing the following, and it will likely be the recommended way of doing so. Not exactly pretty but given it's low density and low use it should be fine.

void OnHTML_NeedsPaint(HTML_NeedsPaint_t pCallback) {
    Debug.Log("[" + HTML_NeedsPaint_t.k_iCallback + " - HTML_NeedsPaint] - " + pCallback.unBrowserHandle + " -- " + pCallback.pBGRA + " -- " + pCallback.unWide + " -- " + pCallback.unTall + " -- " + pCallback.unUpdateX + " -- " + pCallback.unUpdateY + " -- " + pCallback.unUpdateWide + " -- " + pCallback.unUpdateTall + " -- " + pCallback.unScrollX + " -- " + pCallback.unScrollY + " -- " + pCallback.flPageScale + " -- " + pCallback.unPageSerial);

    if (m_Texture == null) {
        m_Texture = new Texture2D((int)pCallback.unWide, (int)pCallback.unTall, TextureFormat.BGRA32, false, true);
    }

    int dataSize = (int)(pCallback.unWide * pCallback.unTall * 4);
    byte[] bytes = new byte[dataSize];
    System.Runtime.InteropServices.Marshal.Copy(pCallback.pBGRA, bytes, 0, dataSize);

    m_Texture.LoadRawTextureData(bytes);
    m_Texture.Apply();
}

from steamworks.net.

CubicCreo avatar CubicCreo commented on September 13, 2024

Thanks!

from steamworks.net.

rlabrecque avatar rlabrecque commented on September 13, 2024

I'll also note since you seem to be the first person actually using this stuff from Steamworks.NET... I'm not sure if TextureFormat.BGRA32 is hooked up correctly on PC platforms. It seems to be greyscale. (but otherwise correct looking)

Needs some more testing, maybe a smaller test case and a ping to Aras from Unity.

from steamworks.net.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.