Peer-to-Peer Forum

 

Login Register    
how to add oponel code into vega prime
Posted: 29 August 2010 11:05 PM  
Newbie
Rank
Total Posts:  2
Joined  2010-08-29

Hi! I was using vc++ and vega prime 3.71 programing,and I also want to use Opengl to draw a curve,but I have no ideo how to add the opengl code in vega prime 3.71.
Is there someone who is so kind to show me?

 
Posted: 30 August 2010 02:15 PM   [ # 1 ]  
Member
RankRankRank
Total Posts:  78
Joined  2009-01-15

version 3.7.1??  There’s version 3.0.x and 4.0.

Anyway, yes, I’ve done it and am currently doing custom drawing using OpenGL in a VegaPrime (VP) 3.0.0 app.

The basic procedure is to get to a hook in the VP pipeline.  In my apps I hook into the Channel drawing.  I do this by deriving a class from vsChannel::Subscriber, overriding they notify() methods and handling an EVENT_XXX_DRAW event.  You register for the event(s) you want to handle.  For example I do some text and graphics overlay drawing so I want to do it when everything else has been drawn already so I handle the vsChannel::Subscriber::EVENT_POST_DRAW event.  My notify method gets called on the post draw, after everything else in that channel has been drawn.

There are some examples on how to create your own custom drawing.  Ones that come to mind are the vsgs_overlay_ogl project under \samples\vsg\vsgs\  and vp_postdraw_3D (two of them) under \samples\vegaprime\vp\.

The overlay sample shows you opengl code in a drawing handler similar to what I am doing.

There are other places (classes) in the VP pipeline where you can perform custom drawing but I told you about the ones I use.

Steve

 



 
   
 

‹‹ bonus pack2.2      Vega 4.0 question ››