Jump to content

  • Log In with Google      Sign In   
  • Create Account

aanthonyz1

Member Since 22 Feb 2011
Offline Last Active Feb 01 2013 01:01 AM
-----

Topics I've Started

Displaying a 2D Image

30 January 2013 - 12:53 PM

Ok so I have a OpenGL application that displays a AVI, so far I have that working. Now I am trying to have it display a 2D Image. My program inceases "phase" everytime I press the enter key and when it is at phase 1, it should display a 2D image but it isnt working, 

 

This is my update function:

void Update (DWORD milliseconds)								// Perform Motion Updates Here
{
	if (g_keys->keyDown [VK_ESCAPE] == TRUE)					// Is ESC Being Pressed?
	{
		TerminateApplication (g_window);						// Terminate The Program
	}

	if (g_keys->keyDown [VK_F1] == TRUE)						// Is F1 Being Pressed?
	{
		//ToggleFullscreen (g_window);							// Toggle Fullscreen Mode
		OpenAudio();
	}
	if(g_keys->keyDown [VK_RETURN] == TRUE)
	{
		phase++;
	}
	next+=milliseconds;											// Increase next Based On The Timer
	frame=next/mpf;												// Calculate The Current Frame

	if (frame>=lastframe)										// Are We At Or Past The Last Frame?
	{
		frame=0;												// Reset The Frame Back To Zero (Start Of Video)
		next=0;													// Reset The Animation Timer (next)
	}
}

 

This is my actual drawing

 

void Draw (void)												// Draw Our Scene
{
	glClear (GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT);		// Clear Screen And Depth Buffer
	switch(phase)
	{
	case 0:
	GrabAVIFrame(frame);										// Grab A Frame From The AVI

	if (bg)														// Is Background Visible?
	{
		glLoadIdentity();										// Reset The Modelview Matrix
		glBegin(GL_QUADS);										// Begin Drawing The Background (One Quad)
			// Front Face
			glTexCoord2f(1.0f, 1.0f); glVertex3f( 15.3f,  8.3f, -20.0f);
			glTexCoord2f(0.0f, 1.0f); glVertex3f(-15.3f,  8.3f, -20.0f);
			glTexCoord2f(0.0f, 0.0f); glVertex3f(-15.3f, -8.3f, -20.0f);
			glTexCoord2f(1.0f, 0.0f); glVertex3f( 15.3f, -8.3f, -20.0f);
		glEnd();												// Done Drawing The Background
	}
	break;
	case 1:

	glBindTexture( GL_TEXTURE_2D, texture );

      glBegin( GL_QUADS );
      glTexCoord2f(1.0f, 1.0f); glVertex3f( 15.3f,  8.3f, -20.0f);
			glTexCoord2f(0.0f, 1.0f); glVertex3f(-15.3f,  8.3f, -20.0f);
			glTexCoord2f(0.0f, 0.0f); glVertex3f(-15.3f, -8.3f, -20.0f);
			glTexCoord2f(1.0f, 0.0f); glVertex3f( 15.3f, -8.3f, -20.0f);
      glEnd();
	break;
	}

	
	glFlush ();													// Flush The GL Rendering Pipeline
}

 

Any help would be appreciated


SDL Video

26 January 2013 - 02:11 AM

Hello, I have been looking around for a way to display video in my game. The videos will mostly be cutscenes and an intro, can anyone help lead me in the right direction?


DirectX 9 or DirectX11?

11 January 2013 - 05:29 PM

I have been looking around on using DirectShow to play an avi file as a cutscene and I have found some code but it is very old. I was wondering if there is a simpler method of playing video now and if is still the same, can someone point me in the right direction to making it work?

 

I have two more questions, what would be the best method to load a model and which version should I use?

For example should I stick with .X files and use DirectX 9, or should I move to DirectX 11? If I do move to DirectX 11 then what should I do about loading models?


Creating a room

10 January 2013 - 08:25 PM

What would be the easiest method of creating a cylinder and turning it into a room for a video game? Its going to be a dungeon and all the rooms are going to be circular like a cylinder. I have no idea how to approach this though...any help?


Scripting

01 January 2013 - 08:34 PM

I am having an issue with scripting. Im writing a Text Based RPG Game in C++ but I have a question about scripting. What would the best method be for writing out the story without directly writing every line in my C++ program?


PARTNERS