article search result of 'DrawIndexedPrimitives' : 1

  1. 2010.12.04 [XNA3.1 index buffer vertex buffter] 교과서와는 다른 버퍼메모리 사용법 (158)

[XNA3.1 index buffer vertex buffter] 교과서와는 다른 버퍼메모리 사용법

한참을 방황했다.. 버퍼가 안되서..

DrawUserIndexPrimitives  vs  DrawIndexPrimitives   라는 주제를 한번쯤 보았을것이다.

물론 후자쪽이 빠르다. 그런데, 가지고 있는 한글번역판 책들은 죄다 xna1.0 버전이라,, 그런지

xna3 에서는 사용법이 달랐다.

Created with colorer-take5 library. Type 'csharp'

public void setVertices()
           // vertices 들 ~//
            //vertexBuff 라는 멤버 변��가 있겠죠..
            vertexBuff = new VertexBuffer(device.GraphicsDevice, VertexPositionNormalTexture.SizeInBytes * vertices.Length, BufferUsage.WriteOnly);
        public void setIndices()

           //index들  ~//
            //indexBuff 라는 멤버 변��가 있겠죠..
            indexBuff = new IndexBuffer(device.GraphicsDevice, typeof(int), indices.Length, BufferUsage.WriteOnly);

         //메인클��스에 update()에 넣어야 함
        public void update()
            device.GraphicsDevice.Vertices[0].SetSource(vertexBuff, 0, VertexPositionNormalTexture.SizeInBytes);
            device.GraphicsDevice.Indices = indexBuff;

        //메인클��스에 draw()에 넣어야함
        public void render(Matrix view , Matrix projection)
            effect.World = Matrix.Identity; ;
            effect.View = view;
            effect.Projection = projection;


            /* //여러개일경우
            foreach (EffectPass p in effect.CurrentTechnique.Passes)
                device.GraphicsDevice.DrawIndexedPrimitives(PrimitiveType.TriangleList, 0, 0, vertices.Length, 0, indices.Length / 3);

            device.GraphicsDevice.DrawIndexedPrimitives(PrimitiveType.TriangleList, 0, 0, vertices.Length, 0, indices.Length / 3);

물론 여러가지 방법이야 있겠지만 꾀나 골머리를 썩은 문제이므로 일단 이대로 ..

update 부분은 render 에도 해도 되나 그냥 로직과 분리를 하고 싶은 마음에서 한거다.

한가지 덧붙이자면

effect.World 라던지 effect.View 라던지 effect.Projection 은 변경사항이 없다면

따로 메소드를 빼서 루프를 돌리지 않는 방법도 있다.

( 첫째도 퍼포먼스 둘째도 퍼포먼스 셋째는 수면... ? )

Yamecoder 야매코더_
XNA 2010. 12. 4. 02:20

댓글을 달아 주세요

  1. 이전 댓글 더보기
  2. BlogIcon authentic louis vuitton handbags 2014.11.28 08:27  수정/삭제  댓글쓰기

    이용약관위배로 관리자 삭제된 댓글입니다.

  3. 匿名 2014.12.03 05:44  수정/삭제  댓글쓰기

    이용약관위배로 관리자 삭제된 댓글입니다.

  4. BlogIcon c型钢压瓦机设备 2015.01.02 19:46  수정/삭제  댓글쓰기

    이용약관위배로 관리자 삭제된 댓글입니다.

  5. 匿名 2015.01.07 17:45  수정/삭제  댓글쓰기

    이용약관위배로 관리자 삭제된 댓글입니다.

  6. 匿名 2015.01.14 18:28  수정/삭제  댓글쓰기

    이용약관위배로 관리자 삭제된 댓글입니다.

  7. 匿名 2015.01.14 18:28  수정/삭제  댓글쓰기

    이용약관위배로 관리자 삭제된 댓글입니다.

  8. 匿名 2015.01.15 12:21  수정/삭제  댓글쓰기

    이용약관위배로 관리자 삭제된 댓글입니다.

  9. 匿名 2015.01.19 10:54  수정/삭제  댓글쓰기

    이용약관위배로 관리자 삭제된 댓글입니다.

  10. 匿名 2015.02.06 14:13  수정/삭제  댓글쓰기















  11. BlogIcon clubmaster Sunglasses 2015.03.05 17:04  수정/삭제  댓글쓰기

    마드Amish Friendship Bread is a delicious and sweet bread that gets passed around from frifinishto friend. This edible chain letter has a distinguishing taste that couldonly be attained from a celebrityter,tiffany co sunglasses. Creating this homemade gift is the giving of our love and time to these we care about.


    1 package active dry yeast
    1/4 cup warm wat료니

  12. BlogIcon duffle coat burberry femme soldes 2015.03.27 21:10  수정/삭제  댓글쓰기

    있네est rare dans les anciens empereurs &eacute;conome, l'aile de l'arm&eacute;e du Nord Fengxiang longue, ce n'est pas juste une relation,En tant que 10 pas le Pr&eacute;sident &agrave; les &eacute;loigner de la tte de club. je ne sais pas comment r&eacute;pondre. il y a quelqu'un pour le duffle coat burberry temps de nettoyage. Et envoy&eacute; affich&eacute; partout l'annonce, le bouddhisme de l'hi데할

  13. BlogIcon burberry homme enfant pas cher 2015.03.30 11:27  수정/삭제  댓글쓰기

    서일r&eacute;cemment, &agrave; cause de la guerre au Myanmar fermement, de nombreuses personnes ont commenc&eacute; &agrave; prter attention &agrave; la Birmanie de noms, note "bold" qui continue de litiges.|

    | j'ai r&eacute;cemment en raison de l'histoire de l'&eacute;change culturel dans l'&eacute;tude th&eacute;matique Nanming et commence &agrave; lire l'histoire plus syst&eacute;matique.1644, 예있

  14. BlogIcon femme burberry pas cher 2015.03.30 11:27  수정/삭제  댓글쓰기

    일뉴Northern empereur Yang magique de pr&eacute;diction de la capacit&eacute; de |

    | les empereurs magique, il y a beaucoup de cette histoire, on peut consid&eacute;rer cela comme une l&eacute;gende, peut tre consid&eacute;r&eacute; comme r&eacute;el.Le lyc&eacute;e est un empereur."22 sur l'histoire de" Qing Yi Zhao a dit: "齐文宣 di accro &agrave; l'alcool, bourr&eacute; de fou, dormir long가일

  15. BlogIcon chaussure burberry homme pas cher 2015.03.31 00:03  수정/삭제  댓글쓰기

    립지URL aIci,chemisier burberry,trench burberry homme相关的主题文章:


  16. 匿名 2015.03.31 08:50  수정/삭제  댓글쓰기

    종이If your maids want to wear the dress again, the truth is that they probably will not because a bridesmaid dress is a formal dress. However, if you choose a color that they can wear again and a simple elegant style, they can. Long dresses can be shortened to knee or tea length. Brooches can be unpinned, straps or a little jacket or shawl can be worn with it. If you INSIST on putting them in baby간전

  17. 匿名 2015.04.01 06:28  수정/삭제  댓글쓰기

    리어They are comfortable and keep your feet feel different! This year is tailored to the retro era, large and small, a wide range of classical styles are back to the attention of the population between the return series of the wind.

    Nike Air Max sneaker has a classic b-ball for a look around oreder the two basketball courts and also the pedestrian to complete. Nike Air Max 95, a draft model Spo니있

  18. 匿名 2015.04.03 17:37  수정/삭제  댓글쓰기

    료리So, how will this all affect the use and spread of mobile applications? Over the past couple of years, we've witnessed the unprecedented success of the iPhone and Apple's App Store and this has clearly demonstrated beyond doubt that there is a voracious appetite for mobile applications.

    Impact on the gaming industry:

    The iPhone and iPod Touch are major competitors in the gaming conso이표

  19. 匿名 2015.04.04 02:54  수정/삭제  댓글쓰기


    POWs and MIAs - Help Needed to Identify Military Remains


    Since wars began, soldiers have died and not been identified, thus the families never were able to get closure. Now DNA can positively identify remains found, but help is needed to see that this happens.

    Those still missing from WWII are a staggering 78,000 Americans; ap그어

  20. 匿名 2015.04.05 10:19  수정/삭제  댓글쓰기

    일다Known publishers from the foreign press, secular, artists, designers and fashionsitas, everybody came from the collection of women Moncler Marmelade Techno equipped with seat belts parka to be seen. They are all "oohed and ahhed" while enjoying hot cider and hot chocolate. Personally.

    Ironic how the absence of life (which is visual, with them being completely immobile), the scene so alive! 단관

  21. 匿名 2015.04.09 00:24  수정/삭제  댓글쓰기

    및마and even better news is that their greatest extent EVER!Beautiful flowers and fittings add a touch of tartan jackets that unmistakable feminine essence,Shopping Tips to Save Money -, while injections of red.

    Purple and orange make this the biggest ever range of colors.Barbour waxed jackets, Barbour International Quilt Jacket, Jackets Barbour Polar Quilt .

    Newlyweds become oldyweds, and조메

Powerd by Tistory, designed by criuce