• Announcements

    • khawk

      Download the Game Design and Indie Game Marketing Freebook   07/19/17

      GameDev.net and CRC Press have teamed up to bring a free ebook of content curated from top titles published by CRC Press. The freebook, Practices of Game Design & Indie Game Marketing, includes chapters from The Art of Game Design: A Book of Lenses, A Practical Guide to Indie Game Marketing, and An Architectural Approach to Level Design. The GameDev.net FreeBook is relevant to game designers, developers, and those interested in learning more about the challenges in game development. We know game development can be a tough discipline and business, so we picked several chapters from CRC Press titles that we thought would be of interest to you, the GameDev.net audience, in your journey to design, develop, and market your next game. The free ebook is available through CRC Press by clicking here. The Curated Books The Art of Game Design: A Book of Lenses, Second Edition, by Jesse Schell Presents 100+ sets of questions, or different lenses, for viewing a game’s design, encompassing diverse fields such as psychology, architecture, music, film, software engineering, theme park design, mathematics, anthropology, and more. Written by one of the world's top game designers, this book describes the deepest and most fundamental principles of game design, demonstrating how tactics used in board, card, and athletic games also work in video games. It provides practical instruction on creating world-class games that will be played again and again. View it here. A Practical Guide to Indie Game Marketing, by Joel Dreskin Marketing is an essential but too frequently overlooked or minimized component of the release plan for indie games. A Practical Guide to Indie Game Marketing provides you with the tools needed to build visibility and sell your indie games. With special focus on those developers with small budgets and limited staff and resources, this book is packed with tangible recommendations and techniques that you can put to use immediately. As a seasoned professional of the indie game arena, author Joel Dreskin gives you insight into practical, real-world experiences of marketing numerous successful games and also provides stories of the failures. View it here. An Architectural Approach to Level Design This is one of the first books to integrate architectural and spatial design theory with the field of level design. The book presents architectural techniques and theories for level designers to use in their own work. It connects architecture and level design in different ways that address the practical elements of how designers construct space and the experiential elements of how and why humans interact with this space. Throughout the text, readers learn skills for spatial layout, evoking emotion through gamespaces, and creating better levels through architectural theory. View it here. Learn more and download the ebook by clicking here. Did you know? GameDev.net and CRC Press also recently teamed up to bring GDNet+ Members up to a 20% discount on all CRC Press books. Learn more about this and other benefits here.
Sign in to follow this  
Followers 0
Conny14156

Pointer array sizeof question?[Problem Found](Embarrassing problem)

7 posts in this topic

Hi, I am trying to send the sizeof a array into the D3D11_BUFFER_DESC.ByteWidth By doing it like this [

 

code=:0]//Some other code

DWORD* indcies_D;indcies_D = new DWORD[Model.Total.Face * 3];

D3D11_BUFFER_DESC indexBufferDesc;ZeroMemory( &indexBufferDesc, sizeof(indexBufferDesc) );

indexBufferDesc.Usage = D3D11_USAGE_DEFAULT;

indexBufferDesc.ByteWidth = sizeof(DWORD) * Model.Total.Face * 3; //<---- This would be complained by the compiler for some reason but not if its * 4

indexBufferDesc.BindFlags = D3D11_BIND_INDEX_BUFFER;

indexBufferDesc.CPUAccessFlags = 0;indexBufferDesc.MiscFlags = 0;

//some more code[/code]

 

am guessing my pointer takes up some extra memory? if so how would I get the size of a pointer o.o?

 

Problem:

was drawing 3 times as much, than what the buffer was created for  

0

Share this post


Link to post
Share on other sites

Less than a error but more of a warning >.<

D3D11: WARNING: ID3D11DeviceContext::DrawIndexed: Index buffer has not enough space! [ EXECUTION WARNING #359: DEVICE_DRAW_INDEX_BUFFER_TOO_SMALL ]

0

Share this post


Link to post
Share on other sites

Hmm that's weird, only thing different from yours to mine is WORD and that is 2 bytes less than DWORD...

 

unsigned int numIndices = Model.Total.Face* 3
indexBufferDesc.ByteWidth = numIndices * sizeof(WORD);

 

Maybe the number of faces is wrong?

1

Share this post


Link to post
Share on other sites

This error means you're trying to draw more triangles than you actually defined in your index buffer.


Yeha I thougth so, i want to know why I get it cause the face*3 is suppose to be the total indices and I just double checked my total vertex I am suppose to draw and it is indeed the same

Hmm that's weird, only thing different from yours to mine is WORD and that is 2 bytes less than DWORD...

unsigned int numIndices = Model.Total.Face* 3indexBufferDesc.ByteWidth = numIndices * sizeof(WORD);


Maybe the number of faces is wrong?

The faces does not get change or suppose to change between the two code, they just a few line apart from each other >.<

 

Seems like using *4 does not work now >.<, Keep complainning about memory heap. I was probably lucky the last time I got it to work before I changed computer 

0

Share this post


Link to post
Share on other sites

This error is being caused by bad parameters to your DrawIndexed call, not by your index buffer creation, so have a look at those, in particular your IndexCount and StartIndexLocation parameters - add them together and you'll find that you're overflowing the size of your index buffer (which is Model.Total.Face * 3).

1

Share this post


Link to post
Share on other sites

[URL=http://imgur.com/4Zmc24Q][/URL]

Here a screen on the

IndexCount(Its suppose to hold how many index/indices its suppose to draw for that group)

StartIndex(and this one suppose to hold how far off its suppose to draw )

And I get the same amount by 

multiplying Face*3 which in this case is 

348, which is also the total of all the index count and the startindex seems to be all right.

 

Edit:

FORGET everything

>.< dammit this is VERY Embarrassing.

 

Thanks for pointing out the draw index, for some stupid reason I also had *3 when I was drawing my object so it was atleast 3 times as much, no wonder my buffer complained.

Really sorry for wasting all of your guys time and such a stupid misstake

 

    for(int i = 0; i < Model.Total.Group; i++)
    {
        Gfx->D3d11DevCon->DrawIndexed
                                    (
                                        Model.DrawingIndexIndices.IndexCount[i]*3,//<---- This was the problem >.<
                                        Model.DrawingIndexIndices.StartIndex[i],
                                        0
                                    );
    }
0

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  
Followers 0