Sign in to follow this  
AquaMacker

Whate is Static VB ?

Recommended Posts

[font="Verdana"]Hi[/font]

[font="Verdana"]What Is Static VB ?[/font]

[font="Verdana"][size="2"][/size][code]
static IDirect3DVertexBuffer9* pVertexBuffer; <- Right ?
pDevice->CreateVertexBuffer( MaxVertexIndex
, D3DUSAGE_WRITEONLY
, NULL
, D3DPOOL_DEFAULT
, &pVertexBuffer
, NULL );
[/code][size="2"] [/size][/font]
[font="Verdana"][/font]
[size="2"][font="Verdana"][color="#000000"]Plz Answer [b]CODE[/b], not Concepts.[/color][/font]
[font="Verdana"][color="#000000"]I know concepts already.[/color][/font]
[font="Verdana"][color="#000000"]^^a[/color][/font] [/size]

Share this post


Link to post
Share on other sites
[quote name='AquaMacker' timestamp='1307018727' post='4818628'][size="2"][font="Verdana"][color="#000000"]I know concepts already.[/color][/font][/size][/quote]

.....no you don't.... ;)

Let me put it this way. If you knew the concepts already you wouldn't be asking this question, and you wouldn't be asking if declaring a variable as static will give you a static VB. You don't know the concepts, and I get the sense that you just want someone to give you a block of code you can copy and paste. If you are just given that you will be using code that you don't understand.

Share this post


Link to post
Share on other sites
[quote name='mhagain' timestamp='1307020282' post='4818635']
[quote name='AquaMacker' timestamp='1307018727' post='4818628'][size="2"][font="Verdana"][color="#000000"] know concepts already.[/color][/font][/size][/quote]

.....no you don't.... ;)

Let me put it this way. If you knew the concepts already you wouldn't be asking this question, and you wouldn't be asking if declaring a variable as static will give you a static VB. You don't know the concepts, and if you are just given code you will be using code that you don't understand.
[/quote]

Hey guy...

I know concept...

but I [b]can't[/b] express That very well..IN ENGLISH...??

[size="2"]I know when talk to CODE.

[/size]Would you answer me "[color="#000088"]static[/color] [color="#660066"]IDirect3DVertexBuffer9[/color][color="#666600"]*[/color] pVertexBuffer[color="#666600"];"[/color] [color="#666600"]<-[/color] [color="#660066"]Right[/color] [color="#666600"]?[/color]
Please...don't leave ^^a

Share this post


Link to post
Share on other sites
[quote name='Hiyar' timestamp='1307020540' post='4818638']
This has nothing to do with the c++ keyword "static"
it is the second parameter in the function
[/quote]

[font="Tahoma"]Sorry.

[/font]"static" is C++ keyword..

Search Please....

Share this post


Link to post
Share on other sites
The [url="http://www.cprogramming.com/tutorial/statickeyword.html"]static keyword[/url] is a C++ keyword which makes the VARIABLE static. It has absolutely nothing to do with the VB contents.

In DirectX terms, a static VB is a VB which has contents that does not change (is static). A static vertex buffer is a vertex buffer created without the D3DUSAGE_DYNAMIC flag.

Share this post


Link to post
Share on other sites
[quote name='Evil Steve' timestamp='1307021193' post='4818647']
The [url="http://www.cprogramming.com/tutorial/statickeyword.html"]static keyword[/url] is a C++ keyword which makes the VARIABLE static. It has absolutely nothing to do with the VB contents.

In DirectX terms, a static VB is a VB which has contents that does not change (is static). A static vertex buffer is a vertex buffer created without the D3DUSAGE_DYNAMIC flag.
[/quote]

thanks you so much ^^a

Share this post


Link to post
Share on other sites
[quote name='Hiyar' timestamp='1307020540' post='4818638']
This has nothing to do with the c++ keyword "static"
it is the second parameter in the function
[/quote]

thanks you so much ^^a

Share this post


Link to post
Share on other sites
Based on this information, the vertex buffer you've created is already static. :)

(MSDN explains D3DUSAGE [url="http://msdn.microsoft.com/en-us/library/bb172625%28v=vs.85%29.aspx"]here[/url], including what values work with what resource types. The one you care about is the "vertex buffer create" column.)

Incidentally, you may want to use D3DPOOL_MANAGED instead of D3DPOOL_DEFAULT so you don't have to rebuild it on a device reset. (See [url="http://msdn.microsoft.com/en-us/library/bb172584%28v=vs.85%29.aspx"]here[/url] for details)

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this