Skip to content

option to omit the C wrapper #5

@GitMensch

Description

@GitMensch

RE e315799

You've noted in your video that you couldn't figure out how to omit the C wrapper.
Doesn't the following work?

77 SDL-RWops-Pointer  usage pointer.

           call 'SDL_RWFromConstMem' using
               by reference ground-asset-data
               by value ground-asset-data-size
               returning SDL-RWops-Pointer
           end-call
           call 'IMG_LoadTexture_RW' using
               by value renderer SDL-RWops-Pointer 1
               returning ground-texture
           end-call

Note: obviously it is quite longer so a wrapper makes sense in any case - the nearest you'd get to that in COBOL would be writing a user-defined-function; the result would be a wrapper invoked as:

           move function loadTextureData (ground-asset-data, renderer)
               to ground-texture

To pass variable lengths you'd use 01 texture-data pic x any length. for the data on the function's LINKAGE, then pass by value function length (texture-data) in the CALL.

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