Git Product home page Git Product logo

directx-game-engine's Introduction

directX 11.1 -game-engine

This is a simple and accessible directX 11.1 game engine for windows 8/8.1 built for UCLA's CS188 class.

It is partially based on Microsoft's spritebatch sample:

http://code.msdn.microsoft.com/windowsapps/Direct3D-sprite-sample-97ae6262

and FallFury by Brian Peek, Clint Rutkas, Dan Fernandez, Den Delimarsky, Rick Barraza:

http://channel9.msdn.com/coding4fun/articles/Fall-Fury-Part-1-Introduction

The objective is to provide an easy to understand engine that one can use to create windows 8/8.1 2d directX games that combine direct3D and direct2D

directx-game-engine's People

Contributors

ksideris avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar

directx-game-engine's Issues

Vector Iteration

The asteroid iteration loop

for (auto asteroid = m_asteroidData.begin(); asteroid != m_asteroidData.end(); asteroid++)

can have some problems with the iterator asteroid being invalidated. Specifically while adding asteroids with

m_asteroidData.push_back(data);

If the adding of the additional data results in vector reallocation, all iterators are invalidated, and an exception can be triggered by next access of asteroid.

I ran into this problem when firing a lot of bullets and when keeping the asteroids created when hit with a bullet around.

I solved this problem by adding new asteroids to a separate vector, which is then safely dumped into the main vector after the entire asteroid loop is complete.

I also changed the standard iteration to a while loop form

auto asteroid = m_asteroidData.begin();
while(asteroid != m_asteroidData.end())

To avoid checking

if (asteroid == m_asteroidData.end())
break;

on each erasure (only checked on the end of the loop where I do asteroid++), though I don't think that should have any affect on this issue.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.