Exemplo n.º 1
0
LetterHunter::LetterHunter(HWND hwnd, int maxTextCount)
	:hwnd_(hwnd),
	maxTextCount_(100),
	d2d_(NULL),
	dinput_(NULL),
	soundManager_(NULL),
	score_(NULL),
	textBuffer_(NULL),
	currentTextObject_(NULL)
{
	// Initialize Direct2D
	d2d_ = new D2D();
	d2d_->createDeviceIndependentResources();
	d2d_->createDeviceResources(hwnd);

	// Initialize Direct Input
	dinput_ = new DInput();
	soundManager_ = new SoundManager();

	// Initialize score obejct
	score_ = new Score(d2d_->getD2DHwndRenderTarget(), d2d_->getDWriteFactory(), hwnd_);
	score_->setColor(D2D1::ColorF(D2D1::ColorF::Red));

	RECT rect;
	GetWindowRect(hwnd_, &rect);

	int width  = rect.right - rect.left;
	int height = rect.bottom - rect.top;

	setWindowWidth(width);
	setWindowHeight(height);
}
Exemplo n.º 2
0
void WindowTree::onRender( RenderContext & context, const RectInt & window )
{
	NodeWindow::onRender( context, window );

	// clear the highlighted item before rendering
	m_pCursorOver = NULL;

	// use a queue to render the tree without recursion
	Queue< Item * > stack;

	int i = 0;
	for(;i<m_pRoot->children.size();i++)
		stack.push( m_pRoot->children[ i ] );

	PointInt pos( window.left, window.top );
	while( stack.valid() )
	{
		Item * pItem = *stack;
		stack.pop();

		onRenderItem( context, window, pos, pItem );

		// if this item is expanded, insert any children into the queue
		if ( pItem->dwFlags & EXPANDED )
		{
			for(i=0;i<pItem->children.size();i++)
				stack.insert( pItem->children[ i ] );
		}
	}

	// update the window height
	setWindowHeight( pos.y - window.top );
}
Exemplo n.º 3
0
 CompressedTextureTest() : ANGLETest(T::GetGlesMajorVersion(), T::GetRequestedRenderer())
 {
     setWindowWidth(512);
     setWindowHeight(512);
     setConfigRedBits(8);
     setConfigGreenBits(8);
     setConfigBlueBits(8);
     setConfigAlphaBits(8);
 }
 PointSpritesTest() : ANGLETest(T::GetGlesMajorVersion(), T::GetPlatform())
 {
     setWindowWidth(windowWidth);
     setWindowHeight(windowHeight);
     setConfigRedBits(8);
     setConfigGreenBits(8);
     setConfigBlueBits(8);
     setConfigAlphaBits(8);
 }
 MaxTextureSizeTest()
 {
     setWindowWidth(512);
     setWindowHeight(512);
     setConfigRedBits(8);
     setConfigGreenBits(8);
     setConfigBlueBits(8);
     setConfigAlphaBits(8);
 }
 UniformTest() : ANGLETest(T::GetGlesMajorVersion(), T::GetPlatform())
 {
     setWindowWidth(128);
     setWindowHeight(128);
     setConfigRedBits(8);
     setConfigGreenBits(8);
     setConfigBlueBits(8);
     setConfigAlphaBits(8);
 }
Exemplo n.º 7
0
 CopyTexImageTest()
 {
     setWindowWidth(16);
     setWindowHeight(16);
     setConfigRedBits(8);
     setConfigGreenBits(8);
     setConfigBlueBits(8);
     setConfigAlphaBits(8);
 }
Exemplo n.º 8
0
 CopyTextureTest()
 {
     setWindowWidth(256);
     setWindowHeight(256);
     setConfigRedBits(8);
     setConfigGreenBits(8);
     setConfigBlueBits(8);
     setConfigAlphaBits(8);
 }
Exemplo n.º 9
0
void LetterHunter::resize(int width, int height)
{
	// resize d2d render target
	d2d_->onResize(width, height);

	// Update window size
	setWindowWidth(width); 
	setWindowHeight(height);
}
Exemplo n.º 10
0
 SRGBTextureTest()
 {
     setWindowWidth(128);
     setWindowHeight(128);
     setConfigRedBits(8);
     setConfigGreenBits(8);
     setConfigBlueBits(8);
     setConfigAlphaBits(8);
 }
 IndexedPointsTest()
 {
     setWindowWidth(128);
     setWindowHeight(128);
     setConfigRedBits(8);
     setConfigGreenBits(8);
     setConfigBlueBits(8);
     setConfigAlphaBits(8);
     setConfigDepthBits(24);
 }
 PBOExtensionTest()
 {
     setClientVersion(2);
     setWindowWidth(32);
     setWindowHeight(32);
     setConfigRedBits(8);
     setConfigGreenBits(8);
     setConfigBlueBits(8);
     setConfigAlphaBits(8);
 }
 WebGLReadOutsideFramebufferTest() : mFBData(kFbWidth, kFbHeight)
 {
     setWindowWidth(kFbWidth);
     setWindowHeight(kFbHeight);
     setConfigRedBits(8);
     setConfigGreenBits(8);
     setConfigBlueBits(8);
     setConfigAlphaBits(8);
     setWebGLCompatibilityEnabled(true);
 }
Exemplo n.º 14
0
 IndexedPointsTest() : ANGLETest(2, EGL_PLATFORM_ANGLE_TYPE_D3D11_ANGLE)
 {
     setWindowWidth(128);
     setWindowHeight(128);
     setConfigRedBits(8);
     setConfigGreenBits(8);
     setConfigBlueBits(8);
     setConfigAlphaBits(8);
     setConfigDepthBits(24);
 }
 DepthStencilFormatsTest()
 {
     setWindowWidth(128);
     setWindowHeight(128);
     setConfigRedBits(8);
     setConfigGreenBits(8);
     setConfigBlueBits(8);
     setConfigAlphaBits(8);
     setClientVersion(2);
 }
Exemplo n.º 16
0
 ReadPixelsTest()
 {
     setClientVersion(3);
     setWindowWidth(32);
     setWindowHeight(32);
     setConfigRedBits(8);
     setConfigGreenBits(8);
     setConfigBlueBits(8);
     setConfigAlphaBits(8);
 }
Exemplo n.º 17
0
 D3DTextureTest()
 {
     setWindowWidth(128);
     setWindowHeight(128);
     setConfigRedBits(8);
     setConfigGreenBits(8);
     setConfigBlueBits(8);
     setConfigAlphaBits(8);
     setConfigDepthBits(24);
     setConfigStencilBits(8);
 }
Exemplo n.º 18
0
    UnpackAlignmentTest() : ANGLETest(T::GetGlesMajorVersion(), T::GetPlatform())
    {
        setWindowWidth(128);
        setWindowHeight(128);
        setConfigRedBits(8);
        setConfigGreenBits(8);
        setConfigBlueBits(8);
        setConfigAlphaBits(8);
        setConfigDepthBits(24);

        mProgram = 0;
    }
    BlendMinMaxTest()
    {
        setWindowWidth(128);
        setWindowHeight(128);
        setConfigRedBits(8);
        setConfigGreenBits(8);
        setConfigBlueBits(8);
        setConfigAlphaBits(8);
        setConfigDepthBits(24);

        mProgram = 0;
        mColorLocation = -1;
    }
    BlendMinMaxTest() : ANGLETest(T::GetGlesMajorVersion(), T::GetPlatform())
    {
        setWindowWidth(128);
        setWindowHeight(128);
        setConfigRedBits(8);
        setConfigGreenBits(8);
        setConfigBlueBits(8);
        setConfigAlphaBits(8);
        setConfigDepthBits(24);

        mProgram = 0;
        mColorLocation = -1;
    }
Exemplo n.º 21
0
 BufferDataTest()
     : mBuffer(0),
       mProgram(0),
       mAttribLocation(-1)
 {
     setWindowWidth(16);
     setWindowHeight(16);
     setConfigRedBits(8);
     setConfigGreenBits(8);
     setConfigBlueBits(8);
     setConfigAlphaBits(8);
     setConfigDepthBits(24);
 }
Exemplo n.º 22
0
    VertexAttributeTest()
    {
        setWindowWidth(128);
        setWindowHeight(128);
        setConfigRedBits(8);
        setConfigGreenBits(8);
        setConfigBlueBits(8);
        setConfigAlphaBits(8);
        setConfigDepthBits(24);

        mProgram = 0;
        mTestAttrib = -1;
        mExpectedAttrib = -1;
    }
Exemplo n.º 23
0
    SwizzleTest()
    {
        setWindowWidth(128);
        setWindowHeight(128);
        setConfigRedBits(8);
        setConfigGreenBits(8);
        setConfigBlueBits(8);
        setConfigAlphaBits(8);
        setClientVersion(3);

        GLenum swizzles[] =
        {
            GL_RED,
            GL_GREEN,
            GL_BLUE,
            GL_ALPHA,
            GL_ZERO,
            GL_ONE,
        };

        for (int r = 0; r < 6; r++)
        {
            for (int g = 0; g < 6; g++)
            {
                for (int b = 0; b < 6; b++)
                {
                    for (int a = 0; a < 6; a++)
                    {
                        swizzlePermutation permutation;
                        permutation.swizzleRed = swizzles[r];
                        permutation.swizzleGreen = swizzles[g];
                        permutation.swizzleBlue = swizzles[b];
                        permutation.swizzleAlpha = swizzles[a];
                        mPermutations.push_back(permutation);
                    }
                }
            }
        }
    }
Exemplo n.º 24
0
ShootingApplication::ShootingApplication( int argc, char *argv[] ):
	GameApplication( argc, argv )
	{		
		setWindowWidth( SCREEN_WIDTH );
		setWindowHeight ( SCREEN_HEIGHT );
	}