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

Don't have refEntity_t/refdef_t be part of the VM API #161

Closed
zturtleman opened this issue Jan 6, 2014 · 3 comments
Closed

Don't have refEntity_t/refdef_t be part of the VM API #161

zturtleman opened this issue Jan 6, 2014 · 3 comments

Comments

@zturtleman
Copy link
Member

Don't have refEntity_t/refdef_t be part of the VM API. They are very likely going to need to change in future.

Instead duplicate the struct on both the renderer and cgame (renderer already has it's own larger versions anyway). Have cgame pass all vars as arguments to AddRefEntityToScene or RenderScene.

Renderer and cgame are then free to add or remove vars as they wish. Also allows cgame to have multiple version of refEntity_t/refdef_t for special cases (want to store more or less info).

OLD: First need to generalize the syscall API, see #158.

@zturtleman
Copy link
Member Author

Or could have data structure be part of API and pass size in with them (or maybe a call to set them at init). In cgame you can have a struct you use and just copy into API struct before passing to client.

hmm. excess copying is bad though?

@zturtleman
Copy link
Member Author

Renderer API

model entity struct and syscall
poly entity struct and syscall
scene struct and syscall

syscall for adding portal sufaces (doesn't need to be a refent, API-wise or usage in cgame)

struct sizes will need to be passed in, either once or each time. tbh each time seems like less of a pain to add... but that would probably be annoying to using trap_ calls directly (instead of hidden in a cgame function). Technically could have size connected to API version, but I'd rather just specify it. Try to avoid version number magic. Hmm, I'm torn about which way to do this... could just put it in cg_syscalls.c inside the traps.

syscall for setting size of renderer API structs.
OR
pass size of struct with it's syscall.

cgame will have it's own structs that are not part of the API, people can change them and do whatever. Just fill in API-struct before make syscall.

cgame gets flexibly (technically not new), cgame renderer API gets method for backwards compatibility.


Passing size of glconfig_t, snapshot_t, and other structs would also be a good idea.

@zturtleman
Copy link
Member Author

Sizes of many structs are now passed in and handled with different size. 91b3375

Split off API changes into #182.

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

No branches or pull requests

1 participant