Skip to content

Naming convention and documentation #265

@malashin

Description

@malashin

Hello,

It's seems that *Texture.GL_BindTexture() and *Texture.GL_UnbindTexture() should be renamed to *Texture.GL_Bind() and *Texture.GL_Unbind().
https://github.com/veandco/go-sdl2/blob/master/sdl/render.go#L573-L589

Is it ok to do? I'm asking since it's quite a breaking change, but there was a similar commit before 4dfff38.


The other thing I'd like to do is to add proper documentation for goDoc.
I've found that someone tried to do this here https://github.com/veandco/go-sdl2/blob/master/sdl/pixels.go#L212-L216.

Should we really have function name stated on two lines and have the link in perentesis?

// UpdateYUV updates a rectangle within a planar YV12 or IYUV texture with new pixel data.
// UpdateYUV (https://wiki.libsdl.org/SDL_UpdateYUVTexture)
func (texture *Texture) UpdateYUV(rect *Rect, yPlane []byte, yPitch int, uPlane []byte, uPitch int, vPlane []byte, vPitch int) error {}

Maybe one of this versions is a better option?

// UpdateYUV updates a rectangle within a planar YV12 or IYUV texture with new pixel data.
// https://wiki.libsdl.org/SDL_UpdateYUVTexture
func (texture *Texture) UpdateYUV(rect *Rect, yPlane []byte, yPitch int, uPlane []byte, uPitch int, vPlane []byte, vPitch int) error {}
// UpdateYUV updates a rectangle within a planar YV12 or IYUV texture with new pixel data. (https://wiki.libsdl.org/SDL_UpdateYUVTexture)
func (texture *Texture) UpdateYUV(rect *Rect, yPlane []byte, yPitch int, uPlane []byte, uPitch int, vPlane []byte, vPitch int) error {}

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions