Giter Club home page Giter Club logo

code's People

Contributors

chalonverse avatar josh1603 avatar michaeleggers avatar pkpprasun avatar tehredplague avatar timgates42 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

code's Issues

Issue with UI TTF Rendering

Everything seems to work fine, build and run is ok but the writings are a horrible rendering artifact made by retorts lines in columns. What could be the issue? Maybe something about compatibility? I'm testing on the latest Ubuntu with a Radeon GPU.

where can i get the fmod api

i downloaded the FMOD Studio Suite
did not see any api on FMOD website

I don't understand this step, could not find any package can put into External/FMOD file
On Mac, copy the contents of the FMOD package into External/FMOD.

Blender Exporter UV coordinates problem.

Hi again Mr Sanjay
i have a problem with the blender exporter script.
i´m trying to replicate the cube found in assets with a simple texture.
(creating a cube in blender 2.79, unwrap and assign a texture)

imagen

but when is loaded on the program of chapter 6 seems that the uv coordinates are wrong
imagen

Comparing the two .gpmesh files (original cube vs my cube) found that the original cube have way more vertices. 28 vs 8. While mi cube have only one UVcoord per vertex , the original cube have diferent combinations of the same vertex with diferent UVcoords.
imagen

imagen

Am i missing some step before exporting the mesh?

Thanks you so much for the book. Sorry for my bad english.
Greetings from México

Inconsistent winding order on faces ?

Enabling back face culling via glEnable(GL_CULL_FACE) makes some elements of the drawn objects appear / disappear.

e.g. enabling culling on chapter 12 shows the character but gui elements (quit menu) are hidden. Flipping the cull face via glFrontFace(GL_CW) flips this around where the gui elements are shown but the model is hidden.

Chapter 1 - Implementation of Game::Update()

First of all thank you for the excellent book.
I was wondering if the implementation of the Game::UpdateGame() in Chapter 1 on page 26 is affected by the different SDL_GetTicks() calls? If I am correct those calls will result in a slightly different number of ticks during the execution of UpdateGame().

This could in easily be solved by adding a local variable storing the result of the call at the begin of UpdateGame():

void Game::UpdateGame()
{
    // Compute delta time
    Uint32 now = SDL_GetTicks(); // call SDL_GetTicks() only once
    
    // Wait until 16ms has elapsed since last frame
    while (!SDL_TICKS_PASSED(now, mTicksCount + 16))
        ;

    float deltaTime = (now - mTicksCount) / 1000.0f;
    if (deltaTime > 0.05f)
    {
        deltaTime = 0.05f;
    }
    mTicksCount = now;
}

Memory.h file missing + 486 other errors?

Hi Sanjay, I have just started chapter two of your book. I downloaded your code for chapter 2 and opened it in Visual Studio 2017 on Windows 10; It is failing to build because the include memory is underlined red and the png files can’t be seen. In the error box there are also 486 other errors relating to missing header files.
I have got all the required C++ workloads installed and up to date SDK, I have had no issues with any other projects I have run.
Any ideas?
Thanks, Mike.

Exporter directory missing?

On page 193 of the book "Game Programming in C++" , 2nd line, it says "To solve this, the GitHub code repository provides two exporters in the Exporter directory" but I can not find it.

Cannot run on Mac OS Mojave

Hi,

I am a very beginner of game design and was trying to run the codes in xcode of Mac OS, but got the following error

2019-01-24 22:12:41.254993-0500 Game-mac[5171:147185] [Game-mac] CGContextSetFillColorWithColor: invalid context 0x0. If you want to see the backtrace, please set CG_CONTEXT_SHOW_BACKTRACE environmental variable.
2019-01-24 22:12:41.255982-0500 Game-mac[5171:147185] [Game-mac] CGContextGetCompositeOperation: invalid context 0x0. If you want to see the backtrace, please set CG_CONTEXT_SHOW_BACKTRACE environmental variable.
2019-01-24 22:12:41.256014-0500 Game-mac[5171:147185] [Game-mac] CGContextSetCompositeOperation: invalid context 0x0. If you want to see the backtrace, please set CG_CONTEXT_SHOW_BACKTRACE environmental variable.
2019-01-24 22:12:41.256025-0500 Game-mac[5171:147185] [Game-mac] CGContextFillRects: invalid context 0x0. If you want to see the backtrace, please set CG_CONTEXT_SHOW_BACKTRACE environmental variable.
2019-01-24 22:12:41.256034-0500 Game-mac[5171:147185] [Game-mac] CGContextSetCompositeOperation: invalid context 0x0. If you want to see the backtrace, please set CG_CONTEXT_SHOW_BACKTRACE environmental variable. Program ended with exit code: 0

Any idea for this please? Thank you.

Change Math.h to GameMath.h

change the name of the headers and source so it doesnt change the declarations of C <math.h> standard header ....

Serious bug in mouse button detection

Hello, first of all I really thank you for writing this book. When I was doing the camera part I noticed the weird behaviour of mouse detection in the InputSystem, turns out it's wrong to test equality for mouse button because valid result should be non-negative but doesn't guarantee 1.

bool MouseState::GetButtonValue(int button) const
{
	return (SDL_BUTTON(button) & mCurrButtons) == 1;  // Will not work!!!
}

The correct code should be

bool MouseState::GetButtonValue(int button) const
{
	return (SDL_BUTTON(button) & mCurrButtons);
}

Blender exporter with animation

Hi and happy new year!
I have written a blender exporter that writes out .gpmesh, .gpskel and .gpanim(s) These are the custom file formats in the book from chapter 12 on.
When loading the files in the engine (I used chapter 12) the gpmesh comes in fine, the tpose is correct but the other
animations are messed up. You can still see the animation matches somewhat the one created in blender but something is wrong there. I was not able to figure out where the mistake happens. To my best knowledge the skeleton and animation files contain the
local transforms of the bones using matrix_local in Blender's python API.

I included the script and the example Blend file (Blender 3.0.0) for testing in my fork: https://github.com/michaeleggers/code/tree/blender-exporter-update/Exporter/Blender

Maybe someone is interested in looking into it.

As I am relatively new to Blender, I used this tutorial to model, rig and animate and also used the texture provided by Imphenzia:
https://youtu.be/yjjLD3h3yRc

Exporter plugin not working?

I'm trying to install the plugin on my Blender (Version 2.79b) running on Windows 10 Pro and when I'm done installing the plugin (through File -> User Preferences -> Add-ons -> Install Add-on from File...) everything seems to be correct but, when I try to look for it on the add-ons Tab I don't see the plugin on the list. And there is no option in the File -> Export menu list. Maybe I'm doing something wrong? or the plugin has to be updated?

BTW: Nice book. I'm learning a lot with it.

Chapter 2 - Pg 42 - Game::Shutdown() or Game::UnloadData()

The book is a great learning experience, so please forgive any too detailed comments.

In chapter 2 page 42 the line

However, this means that the code that loops over the mActors vector and deletes the actors (such as in Game::Shutdown) must be written carefully:

The actual loop which is given in the book is in the member function Game::UnloadData() (which is actually called from Game::Shutdown)

Chapter 10 page 327 : Missing code!

Source code is correct on this but just throwing it out there that PhysWorld::SegmentCast implementation in the book is missing
"closestT = t;" in the example code after "if (t < closestT)" on page 327.

Didn't know if this was appropriate errata, but I'm sure you'd like to be aware of typos! Fantastic book by the way.

Typo in Appendix A: Intermediate C++ Review

// Get an iterator to the element with the key 2
std::map<int, std::string> iter = months.find(2);  // SHOULD BE std::map<int, std::string>::iterator iter = months.find(2);  
if (iter != months.end()) // This is only true if found
{
   std::cout << iter->first << std::endl; // Outputs 2
   std::cout << iter->second << std::endl; // Outputs February
}

I find this in my kindle version of the book, however, I can't seem to find page number anywhere.
Thanks for the great book!

Original sound files

Hello,
I'm on chapter 7 and instead of using fmod, I want to use openal soft. Is it possible to share the original sound files instead of just the bank files?

Thanks.

Sprite Batching enabled?

I had a question regarding the 2D example using OpenGL.

Because the draw components happen all at once as it loops through the sprite components, is this considered sprite batching? Or do I still need to find a way to implement that so it all happens at one draw call? If so, any ideas using the same structure as this code?

Thanks

Concise NearZero function

In math library, the extra branching statement for NearZero function is redundant
Original

	inline bool NearZero(float val, float epsilon = 0.001f)
	{
		if (fabs(val) <= epsilon)
		{
			return true;
		}
		else
		{
			return false;
		}
	}

Suggested:

	inline bool NearZero(float val, float epsilon = 0.001f)
	{
		return fabs(val) <= epsilon);
	}

Chapter 05 Runs Slow

Hi mr Sanjay, first of all thank you for your books about game development.
Is normal that the game example of the chapter 5 runs slow compared with the sdl version(no opengl)?

on Asteroid.cpp i have this error:
sc->SetTexture(game->GetTexture("Assets/Asteroid.png"));

Error E0167 argument of type "Texture *" is incompatible with parameter of type "Texture *"

Thank you in advance. Greetings from México.

Errata

Is there an errata section for this book? I've seen different stuff from the source code, so I think it's messing me up at times.

A way to draw simple lines

Hi
I want to be able to draw some simple axis lines in the meshComponents. i have added an "AxisComponent" that works similar to MeshComponent.
To be able to see if it draws anything, i set glPolygonMode(GL_FRONT_AND_BACK, GL_LINE);

My draw method looks like this:
void AxisComponent::Draw(Shader* shader)
{
// Set the world transform
shader->SetMatrixUniform("WorldTransform", Owner->GetWorldTransform());
glBegin(GL_TRIANGLES);
glColor3f(1.0f, 1.0f, 0.0f);
glVertex3d(0.0f, 0.0f, 0.0f);
glVertex3d(500.0f, 500.0f, 500.0f);
glVertex3d(0.0f, 500.0f, 500.0f);
glEnd();
}

what do i do wrong?

Stuck on Exercise 2.3

Hey there. I'm stuck on Exercise 2.3 and not entirely sure of a few things.

  • How do I figure out where the tiles should be rendered? I've assumed starting at { 0, 0 }, but not sure if that's correct.

  • How do I calculate the size of the tiles? I imported the CSV as a matrix and used the H and W of that as the H and W of each tile.

  • What should the scene look like? I'm not entirely sure what I should be trying to achieve.

Also, I'm not entirely sure if I'm using SDL_RenderCopyEx correctly. I have:

SDL_RenderCopyEx(
					renderer,
					mTexture,
					&rect,
					nullptr,
					-Math::ToDegrees(mOwner->GetRotation()),
					nullptr,
					SDL_FLIP_NONE
				);

It's rendering stuff, but again, not entirely sure if I'm going in the right direction.

Apologies if this isn't the right place to post these questions. I wasn't sure how else to get the answers! :)

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.