Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

option to omit the C wrapper #5

Open
GitMensch opened this issue Jun 4, 2023 · 1 comment
Open

option to omit the C wrapper #5

GitMensch opened this issue Jun 4, 2023 · 1 comment

Comments

@GitMensch
Copy link

GitMensch commented Jun 4, 2023

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.

@tjpalmer
Copy link
Contributor

Thanks for the info! I'll try to look into it soon.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants