Jump to content

  • Log In with Google      Sign In   
  • Create Account

Emulating OpenGL's bind style ...


Old topic!
Guest, the last post of this topic is over 60 days old and at this point you may not reply in this topic. If you wish to continue this conversation start a new topic.

  • You cannot reply to this topic
2 replies to this topic

#1 Ranger_One   Members   -  Reputation: 300

Like
Likes
Like

Posted 17 June 2001 - 05:02 AM

I would like to emulate OpenGL''s bind style within my API I''m writing... like this
  
xxBindObject(pObject);

xxRotate(pObject);
xxScale(pObject);

xxRelease(pObject);
  
here is the catch, my app is multithreaded, and I want each thread to be able to use the xxBind() and not have them conflict. I''m certain the OpenGl uses a single static variable to hold the pointer/handle... but that won''t work for me. how can this be done? how can one determine which thread they are in? or can seperate static variables be made for each thread? any ideas welcome, Jason

Sponsor:

#2 Ranger_One   Members   -  Reputation: 300

Like
Likes
Like

Posted 17 June 2001 - 05:10 AM

hmmm... I could use GetCurrentThreadId() too identify the thread... how fast is that function? but then I would have to lookup the bind information from a table for each function... too much overhead...

back to the drawing board... must be a way to cheat the system here




#3 Null and Void   Moderators   -  Reputation: 1087

Like
Likes
Like

Posted 17 June 2001 - 09:30 AM

I think you should probably give each thread its own states, so that they''re independent of each other. The previous version of my engine wad modeled after OpenGL (which is a finite state machine), and it wasn''t easy to do .

[Resist Windows XP''s Invasive Production Activation Technology!]




Old topic!
Guest, the last post of this topic is over 60 days old and at this point you may not reply in this topic. If you wish to continue this conversation start a new topic.



PARTNERS