Beispiel #1
0
void WebRequestObject::Init(const char* host, int port)
{
    LOGInfo( LOGTag, "WebRequestObject::Init %s:%d\n", host, port );
    sprintf( m_HostString, "%s:%d", host, port );
    LOGInfo( LOGTag, "WebRequestObject::Init %s\n", m_HostString );
    m_SomethingWentWrong = false;
}
Beispiel #2
0
void D3DCreateDepthStencilStates()
{
    HRESULT result;

    D3D11_DEPTH_STENCIL_DESC depthDisabledStencilDesc;
    ZeroMemory(&depthDisabledStencilDesc, sizeof(depthDisabledStencilDesc));

    depthDisabledStencilDesc.DepthEnable = true;
    depthDisabledStencilDesc.DepthWriteMask = D3D11_DEPTH_WRITE_MASK_ALL;
    depthDisabledStencilDesc.DepthFunc = D3D11_COMPARISON_LESS_EQUAL;
    depthDisabledStencilDesc.StencilEnable = true;
    depthDisabledStencilDesc.StencilReadMask = 0xFF;
    depthDisabledStencilDesc.StencilWriteMask = 0xFF;
    depthDisabledStencilDesc.FrontFace.StencilFailOp = D3D11_STENCIL_OP_KEEP;
    depthDisabledStencilDesc.FrontFace.StencilDepthFailOp = D3D11_STENCIL_OP_INCR;
    depthDisabledStencilDesc.FrontFace.StencilPassOp = D3D11_STENCIL_OP_KEEP;
    depthDisabledStencilDesc.FrontFace.StencilFunc = D3D11_COMPARISON_ALWAYS;
    depthDisabledStencilDesc.BackFace.StencilFailOp = D3D11_STENCIL_OP_KEEP;
    depthDisabledStencilDesc.BackFace.StencilDepthFailOp = D3D11_STENCIL_OP_DECR;
    depthDisabledStencilDesc.BackFace.StencilPassOp = D3D11_STENCIL_OP_KEEP;
    depthDisabledStencilDesc.BackFace.StencilFunc = D3D11_COMPARISON_ALWAYS;

    // Test: Enabled    Write: Enabled
    depthDisabledStencilDesc.DepthEnable = true;
    depthDisabledStencilDesc.DepthWriteMask = D3D11_DEPTH_WRITE_MASK_ALL;
    result = g_pD3DDevice->CreateDepthStencilState( &depthDisabledStencilDesc, &g_pD3DDepthStencilState_DepthTestEnabled_DepthWriteEnabled );
    if( FAILED( result ) )
    {
        LOGInfo( LOGTag, "Failed to create DepthStencilState\n" );
    }

    // Test: Disabled   Write: Enabled
    depthDisabledStencilDesc.DepthEnable = false;
    depthDisabledStencilDesc.DepthWriteMask = D3D11_DEPTH_WRITE_MASK_ALL;
    result = g_pD3DDevice->CreateDepthStencilState( &depthDisabledStencilDesc, &g_pD3DDepthStencilState_DepthTestDisabled_DepthWriteEnabled );
    if( FAILED( result ) )
    {
        LOGInfo( LOGTag, "Failed to create DepthStencilState\n" );
    }

    // Test: Enabled    Write: Disabled
    depthDisabledStencilDesc.DepthEnable = true;
    depthDisabledStencilDesc.DepthWriteMask = D3D11_DEPTH_WRITE_MASK_ZERO;
    result = g_pD3DDevice->CreateDepthStencilState( &depthDisabledStencilDesc, &g_pD3DDepthStencilState_DepthTestEnabled_DepthWriteDisabled );
    if( FAILED( result ) )
    {
        LOGInfo( LOGTag, "Failed to create DepthStencilState\n" );
    }

    // Test: Disabled   Write: Disabled
    depthDisabledStencilDesc.DepthEnable = false;
    depthDisabledStencilDesc.DepthWriteMask = D3D11_DEPTH_WRITE_MASK_ZERO;
    result = g_pD3DDevice->CreateDepthStencilState( &depthDisabledStencilDesc, &g_pD3DDepthStencilState_DepthTestDisabled_DepthWriteDisabled );
    if( FAILED( result ) )
    {
        LOGInfo( LOGTag, "Failed to create DepthStencilState\n" );
    }
}
void ParticleRenderer::AllocateVertices(unsigned int numpoints, const char* category)
{
    LOGInfo( LOGTag, "ParticleRenderer: Allocating %d Verts\n", numpoints );

    assert( m_pVertexBuffer == 0 );

#if USE_INDEXED_TRIANGLES
    unsigned int numverts = numpoints * 4;
    unsigned int numindices = numpoints * 6;
#else
    unsigned int numverts = numpoints;
    unsigned int numindices = 0;
#endif

    Vertex_PointSprite* pVerts = MyNew Vertex_PointSprite[numverts];
    m_NumVertsAllocated = numverts;

    LOGInfo( LOGTag, "ParticleRenderer: about to call glGenBuffers\n" );

    m_pVertexBuffer = g_pBufferManager->CreateBuffer( pVerts, sizeof(Vertex_PointSprite)*numverts, GL_ARRAY_BUFFER, GL_DYNAMIC_DRAW, true, 2, VertexFormat_PointSprite, category, "Particles-Verts" );

    LOGInfo( LOGTag, "ParticleRenderer: m_pVertexBuffer->m_BufferID = %d\n", m_pVertexBuffer->m_CurrentBufferID );

    if( numindices != 0 )
    {
        GLushort* tempindices = MyNew GLushort[numindices]; // deleted eventually by buffermanager/bufferdef
        for( GLushort i=0; i<numpoints; i++ )
        {
#if !USE_D3D
            // Counter-clockwise
            tempindices[i*6+0] = i*4+0;
            tempindices[i*6+1] = i*4+2;
            tempindices[i*6+2] = i*4+1;
            tempindices[i*6+3] = i*4+2;
            tempindices[i*6+4] = i*4+3;
            tempindices[i*6+5] = i*4+1;
#else
            // This is insane, should be just changing cull winding order
            // fix if d3d is ever tested again.
            assert( false );
            // clockwise
            tempindices[i*6+0] = i*4+0;
            tempindices[i*6+1] = i*4+1;
            tempindices[i*6+2] = i*4+2;
            tempindices[i*6+3] = i*4+2;
            tempindices[i*6+4] = i*4+1;
            tempindices[i*6+5] = i*4+3;
#endif
        }

        m_pIndexBuffer = g_pBufferManager->CreateBuffer( tempindices, sizeof(unsigned short)*numindices, GL_ELEMENT_ARRAY_BUFFER, GL_STATIC_DRAW, true, 1, 2, category, "Particles-Indices" );
    }

    //m_pVAO = g_pBufferManager->CreateVAO();
}
Beispiel #4
0
void glBufferSubData(GLenum target, GLintptr offset, GLsizeiptr size, const GLvoid* data)
{
    if( g_pD3DDevice == 0 )
    {
        LOGInfo( LOGTag, "Trying to buffer data before d3d is initialized!\n" );
        return;
    }

    int buffer = -1;

    if( target == GL_ARRAY_BUFFER )
        buffer = g_ActiveBufferObject_Array;
    else if( target == GL_ELEMENT_ARRAY_BUFFER )
        buffer = g_ActiveBufferObject_ElementArray;

    if( buffer == -1 )
    {
        LOGInfo( LOGTag, "glBufferSubData() buffer not found!\n" );
        return;
    }

    assert( g_D3DBufferObjects[buffer].m_InUse == true );

    if( g_D3DBufferObjects[buffer].m_Buffer == 0 )
    {
        LOGInfo( LOGTag, "glBufferSubData() buffer not allocated!\n" );
        return;
    }

    // set the buffer data:
    if( data != 0 )
    {
        D3D11_MAPPED_SUBRESOURCE mappedResource;

        // Lock the vertex buffer so it can be written to.
        HRESULT result = g_pD3DContext->Map( g_D3DBufferObjects[buffer].m_Buffer.Get(), 0,
                                             D3D11_MAP_WRITE_DISCARD, 0, &mappedResource );
        if( FAILED(result) )
            return;

        // Get a pointer to the data in the vertex buffer.
        void* verticesPtr = (void*)((int*)mappedResource.pData + offset);

        // Copy the data into the vertex buffer.
        memcpy( verticesPtr, (void*)data, size );

        // Unlock the vertex buffer.
        g_pD3DContext->Unmap( g_D3DBufferObjects[buffer].m_Buffer.Get(), 0 );
    }
}
Beispiel #5
0
void D3DCreateBlendStates()
{
    HRESULT result;

    // Set up the common properties for our blend states... set up default to disabled.
    D3D11_BLEND_DESC blendStateDesc;
    ZeroMemory( &blendStateDesc, sizeof(D3D11_BLEND_DESC) );

    blendStateDesc.RenderTarget[0].BlendEnable = FALSE;
    blendStateDesc.RenderTarget[0].BlendOp = D3D11_BLEND_OP_ADD;
    blendStateDesc.RenderTarget[0].BlendOpAlpha = D3D11_BLEND_OP_ADD;
    blendStateDesc.RenderTarget[0].SrcBlend = D3D11_BLEND_SRC_ALPHA;
    blendStateDesc.RenderTarget[0].DestBlend = D3D11_BLEND_INV_SRC_ALPHA;
    blendStateDesc.RenderTarget[0].SrcBlendAlpha = D3D11_BLEND_SRC_ALPHA;
    blendStateDesc.RenderTarget[0].DestBlendAlpha = D3D11_BLEND_INV_SRC_ALPHA;
    blendStateDesc.RenderTarget[0].RenderTargetWriteMask = D3D11_COLOR_WRITE_ENABLE_ALL;

    // Create a disabled blend state
    blendStateDesc.RenderTarget[0].BlendEnable = FALSE;
    result = g_pD3DDevice->CreateBlendState( &blendStateDesc, &g_pD3DBlendStateDisabled );
    if( FAILED( result ) )
    {
        LOGInfo( LOGTag, "Failed to create BlendState\n" );
    }

    // Create an enabled blend state
    blendStateDesc.RenderTarget[0].BlendEnable = TRUE;
    blendStateDesc.RenderTarget[0].SrcBlend = D3D11_BLEND_SRC_ALPHA;
    blendStateDesc.RenderTarget[0].DestBlend = D3D11_BLEND_INV_SRC_ALPHA;
    blendStateDesc.RenderTarget[0].SrcBlendAlpha = D3D11_BLEND_SRC_ALPHA;
    blendStateDesc.RenderTarget[0].DestBlendAlpha = D3D11_BLEND_INV_SRC_ALPHA;
    result = g_pD3DDevice->CreateBlendState( &blendStateDesc, &g_pD3DBlendStateEnabled );
    if( FAILED( result ) )
    {
        LOGInfo( LOGTag, "Failed to create BlendState\n" );
    }

    // Create a additive blend state
    blendStateDesc.RenderTarget[0].BlendEnable = TRUE;
    blendStateDesc.RenderTarget[0].SrcBlend = D3D11_BLEND_ONE;
    blendStateDesc.RenderTarget[0].DestBlend = D3D11_BLEND_ONE;
    blendStateDesc.RenderTarget[0].SrcBlendAlpha = D3D11_BLEND_ONE;
    blendStateDesc.RenderTarget[0].DestBlendAlpha = D3D11_BLEND_ONE;
    result = g_pD3DDevice->CreateBlendState( &blendStateDesc, &g_pD3DBlendStateEnabledAdditive );
    if( FAILED( result ) )
    {
        LOGInfo( LOGTag, "Failed to create BlendState\n" );
    }
}
void ComponentAnimationPlayer2D::OnFileUpdated(MyFileObject* pFile)
{
    if( pFile == m_pAnimationFile )
    {
        LOGInfo( LOGTag, "TODO: animation file changed, update it\n" );
    }
}
Beispiel #7
0
SoundPlayer::SoundPlayer()
{
    m_NumAudioBuffersLoaded = 0;

    const uint32_t kSampleFrameCount = 1000u; //32768u; //4096u;

// TODONACLUPDATE: test -> added g_pInstance to call below.
    // Ask the browser/device for an appropriate sample frame count size.
    m_SampleFrameCount = pp::AudioConfig::RecommendSampleFrameCount( g_pInstance, PP_AUDIOSAMPLERATE_44100, kSampleFrameCount );

    // Create an audio configuration resource.
    pp::AudioConfig audio_config = pp::AudioConfig( g_pInstance, PP_AUDIOSAMPLERATE_44100, m_SampleFrameCount );

    // Create an audio resource.
    m_AudioObj = pp::Audio( g_pInstance, audio_config, FillBufferCallback, this );

    // Start playback when the module instance is initialized.
    m_AudioObj.StartPlayback();

    for( int i=0; i<MAX_AUDIO_FILES; i++ )
    {
        m_WaveDescriptors[i].valid = false;
    }

    m_SoundCueQueue.AllocateObjects( MAX_AUDIO_FILES_QUEUED );
    for( unsigned int i=0; i<m_SoundCueQueue.Length(); i++ )
    {
        m_SoundCueQueue.AddInactiveObject( MyNew SoundCueWrapper );
    }

    LOGInfo( LOGTag, "NaCL SoundPlayer created: m_SampleFrameCount:%d\n", m_SampleFrameCount );
}
Beispiel #8
0
void WebRequestObject::Reset()
{
    LOGInfo( LOGTag, "WebRequestObject::Reset\n" );

    m_SomethingWentWrong = false;
    SAFE_DELETE( m_pFileObject );
}
Screen_Pause::Screen_Pause()
{
    m_MenuItemsNeeded = 6;

    LOGInfo( LOGTag, "[Flow] - Showing Screen_Pause\n" );

    //g_pGame->m_GamePaused = true;
}
Beispiel #10
0
bool CTestClient::OnDisconnect()
{
	LOGInfo("client disconnected.");

	m_pNetSocket = nullptr;

	return true;
}
Beispiel #11
0
int SoundPlayer::LoadSound(const char* buffer, unsigned int buffersize)
{
    LOGInfo( LOGTag, "NaCL SoundPlayer::LoadSound, buffersize:%d\n", buffersize );

    MyAssert( m_NumAudioBuffersLoaded < MAX_AUDIO_FILES );

    m_WaveDescriptors[m_NumAudioBuffersLoaded] = WaveLoader::ParseWaveBuffer( buffer, buffersize );
    MyAssert( m_WaveDescriptors[m_NumAudioBuffersLoaded].valid );

    LOGInfo( LOGTag, "NaCL SoundPlayer parsed, bytes:%d, channels:%d, samples:%d, size:%d\n", 
        m_WaveDescriptors[m_NumAudioBuffersLoaded].bytespersample,
        m_WaveDescriptors[m_NumAudioBuffersLoaded].numchannels,
        m_WaveDescriptors[m_NumAudioBuffersLoaded].samplerate,
        m_WaveDescriptors[m_NumAudioBuffersLoaded].datasize );

    m_NumAudioBuffersLoaded++;

    return m_NumAudioBuffersLoaded-1;
}
uint32 ComponentAnimationPlayer2D::GetAnimationIndexByName(const char* name)
{
    if( m_pAnimInfo == 0 )
    {
        LOGInfo( LOGTag, "Warning: GetAnimationIndexByName: Animation control file not set\n" );
        return 0;
    }

    return m_pAnimInfo->GetAnimationIndexByName( name );
}
Beispiel #13
0
void WebRequestObject::RequestWebPage(const char* page, ...)
{
    LOGInfo( LOGTag, "WebRequestObject::RequestWebPage %s\n", page );

    va_list arg;
    va_start( arg, page );
    vsnprintf( m_PageWanted, sizeof(m_PageWanted), page, arg );
    va_end( arg );
    m_PageWanted[MAX_URLLength+1-1] = 0; // vsnprintf_s might do this, but docs are unclear

    char tempstr[MAX_URLLength];
    sprintf( tempstr, "http://%s%s", m_HostString, m_PageWanted );

    LOGInfo( LOGTag, "WebRequestObject::RequestWebPage %s\n", tempstr );

    m_pFileObject = MyNew NaCLFileObject( g_pInstance );
    m_pFileObject->GetURL( m_PageWanted );
    //m_pFileObject->GetURL( tempstr );
    //m_pFileObject->GetURL( page );
}
Beispiel #14
0
void D3DCreateSamplerStates()
{
    HRESULT result;

    // Set up the common properties for our samplers
    D3D11_SAMPLER_DESC samplerDesc;
    ZeroMemory( &samplerDesc, sizeof(D3D11_SAMPLER_DESC) );

    samplerDesc.Filter = D3D11_FILTER_MIN_MAG_MIP_POINT;
    samplerDesc.AddressU = D3D11_TEXTURE_ADDRESS_WRAP;
    samplerDesc.AddressV = D3D11_TEXTURE_ADDRESS_WRAP;
    samplerDesc.AddressW = D3D11_TEXTURE_ADDRESS_WRAP;
    samplerDesc.MipLODBias = 0.0f;
    samplerDesc.MaxAnisotropy = 1;
    samplerDesc.ComparisonFunc = D3D11_COMPARISON_ALWAYS;
    samplerDesc.BorderColor[0] = 0;
    samplerDesc.BorderColor[1] = 0;
    samplerDesc.BorderColor[2] = 0;
    samplerDesc.BorderColor[3] = 0;
    samplerDesc.MinLOD = 0;
    samplerDesc.MaxLOD = D3D11_FLOAT32_MAX;

    // Create a texture sampler state for nearest/point sampling and wrapping uv's
    result = g_pD3DDevice->CreateSamplerState( &samplerDesc, &g_pD3DSampleStateNearestWrap );
    if( FAILED( result ) )
    {
        LOGInfo( LOGTag, "Failed to create SamplerState\n" );
    }

    // Create a texture sampler state for tri-linear sampling and wrapping uv's
    samplerDesc.Filter = D3D11_FILTER_MIN_MAG_MIP_LINEAR;
    result = g_pD3DDevice->CreateSamplerState( &samplerDesc, &g_pD3DSampleStateLinearWrap );
    if( FAILED( result ) )
    {
        LOGInfo( LOGTag, "Failed to create SamplerState\n" );
    }
}
Beispiel #15
0
bool CClient::OnConnected(INetSocket *pNetSocket)
{
	if (nullptr == pNetSocket)
	{
		return false;
	}

	m_pNetSocket = pNetSocket;

	LOGInfo("one client connected[localIP:" + m_pNetSocket->GetLocalIP() + ",localPort:"
		+ m_pNetSocket->GetLocalPort() + ", remoteIP:" + m_pNetSocket->GetRemoteIP() + ", remotePort:"
		+ m_pNetSocket->GetRemotePort() + "].");

	return true;
}
Beispiel #16
0
FBODefinition* TextureManager::CreateFBO(int width, int height, int minfilter, int magfilter, bool needcolor, int depthbits, bool depthreadable, bool onlyfreeonshutdown)
{
    LOGInfo( LOGTag, "CreateFBO - %dx%d\n", width, height );

    FBODefinition* pFBO = MyNew FBODefinition();
    bool newtexneeded = pFBO->Setup( width, height, minfilter, magfilter, needcolor, depthbits, depthreadable );
    pFBO->m_OnlyFreeOnShutdown = onlyfreeonshutdown;

    if( newtexneeded )
    {
        m_UninitializedFBOs.AddTail( pFBO );
    }

    return pFBO;
}
Beispiel #17
0
void SoundPlayer::PlaySound(int soundid, bool looping)
{
    LOGInfo( LOGTag, "NaCL SoundPlayer PlaySound soundid %d looping %d\n", soundid, looping );

    if( soundid == -1 )
        return;
    
    SoundCueWrapper* pCueInfo = m_SoundCueQueue.MakeObjectActive();

    if( pCueInfo )
    {
        pCueInfo->descindex = soundid;
        pCueInfo->offset = 0;
        pCueInfo->looping = looping;
    }
}
Beispiel #18
0
// return true if new texture was needed.
bool TextureManager::ReSetupFBO(FBODefinition* pFBO, int width, int height, int minfilter, int magfilter, bool needcolor, int depthbits, bool depthreadable)
{
    //MyAssert( width > 0 && height > 0 );
    if( width <= 0 || height <= 0 )
        return false;
    //LOGInfo( LOGTag, "ReSetupFBO - %dx%d\n", width, height );

    bool newtexneeded = pFBO->Setup( width, height, minfilter, magfilter, needcolor, depthbits, depthreadable );

    if( newtexneeded )
    {
        LOGInfo( LOGTag, "ReSetupFBO - Creating new FBO textures %dx%d\n", width, height );
        InvalidateFBO( pFBO );
    }

    return newtexneeded;
}
Beispiel #19
0
TextureDefinition* TextureManager::CreateTexture(const char* texturefilename, int minfilter, int magfilter, int wraps, int wrapt)
{
    MyAssert( texturefilename );

    LOGInfo( LOGTag, "CreateTexture - %s\n", texturefilename );

    // find the texture if it already exists:
    TextureDefinition* pTextureDef = FindTexture( texturefilename );
    if( pTextureDef != 0 )
    {
        pTextureDef->AddRef();
        return pTextureDef;
    }

    // Create a new texture and add it to m_TexturesStillLoading
    pTextureDef = MyNew TextureDefinition();
    pTextureDef->m_ManagedByTextureManager = true;
    strcpy_s( pTextureDef->m_Filename, MAX_PATH, texturefilename );
    pTextureDef->m_MinFilter = minfilter;
    pTextureDef->m_MagFilter = magfilter;
    pTextureDef->m_WrapS = wraps;
    pTextureDef->m_WrapT = wrapt;

    m_TexturesStillLoading.AddTail( pTextureDef );

    // if the file load hasn't started... start the file load.
    MyAssert( pTextureDef->m_pFile == 0 );
#if 0 //MYFW_ANDROID
    //LOGInfo( LOGTag, "Loading Texture: pTextureDef->m_pFile %d\n", pTextureDef->m_pFile );
    if( pTextureDef->m_pFile == 0 )
    {
        pTextureDef->m_pFile = RequestTexture( pTextureDef->m_Filename, pTextureDef );
        //textureloaded = true;
    }
#else
    if( pTextureDef->m_pFile == 0 )
    {
        //LOGInfo( LOGTag, "Loading Texture: RequestFile\n" );
        pTextureDef->m_pFile = RequestFile( pTextureDef->m_Filename );
        //LOGInfo( LOGTag, "Loading Texture: ~RequestFile\n" );
    }
#endif

    return pTextureDef;
}
Beispiel #20
0
void WebRequestObject::RequestEnd()
{
    LOGInfo( LOGTag, "WebRequestObject - RequestWebPage\n" );

    MyAssert( IsBusy() == false );
    if( IsBusy() )
        return;

    m_PageWanted[ strlen(m_PageWanted)-1 ] = 0; // remove the final ? or &

    char tempstr[MAX_URLLength];
    sprintf( tempstr, "http://%s%s", m_HostString, m_PageWanted );

    //LOGInfo( LOGTag, "WebRequestObject - RequestEnd host - %s\n", m_HostString );
    //LOGInfo( LOGTag, "WebRequestObject - RequestEnd page - %s\n", m_PageWanted );
    //LOGInfo( LOGTag, "WebRequestObject - RequestEnd temp - %s\n", tempstr );

    m_pFileObject = MyNew NaCLFileObject( g_pInstance );
    m_pFileObject->GetURL( m_PageWanted );
    //m_pFileObject->GetURL( tempstr );
    //m_pFileObject->GetURL( page );
}
Beispiel #21
0
bool CTestClient::OnConnected(INetSocket *pNetSocket)
{
	if (nullptr == pNetSocket)
	{
		return false;
	}

	m_pNetSocket = pNetSocket;

	LOGInfo("client connected server[localIP:" + m_pNetSocket->GetLocalIP() + ",localPort:"
		+ m_pNetSocket->GetLocalPort() + ", remoteIP:" + m_pNetSocket->GetRemoteIP() + ", remotePort:"
		+ m_pNetSocket->GetRemotePort() + "]。");

	this->SendMsg(100, "helloworld!");
	this->SendMsg(1001, "0");
	this->SendMsg(1001, "50");
	this->SendMsg(1001, "100");
	this->SendMsg(1002, "0");
	this->SendMsg(1002, "11111");
	this->SendMsg(1002, "22222");

	return true;
}
Beispiel #22
0
bool CClient::OnDisconnect()
{
	LOGInfo("connection is disconnect.");

	SEsp8266Info *pEspInfo = CEsp8266Mgr::getMe().Find(m_strAccount);
	if (pEspInfo)
	{
		if (this == pEspInfo->pClientApp)
		{
			pEspInfo->pClientApp = nullptr;
		}

		if (this == pEspInfo->pClientEsp)
		{
			pEspInfo->pClientEsp = nullptr;
		}
	}

	m_strAccount.clear();

	m_pNetSocket = nullptr;

	return true;
}
Beispiel #23
0
void glUniform4f(GLint location, GLfloat v0, GLfloat v1, GLfloat v2, GLfloat v3)
{
    LOGInfo( LOGTag, "********************************* glUniform4f() not implemented\n" );
}
Beispiel #24
0
void WebRequestObject::ClearResult()
{
    LOGInfo( LOGTag, "WebRequestObject::ClearResult\n" );

    SAFE_DELETE( m_pFileObject );
}
int MyMeshText::CreateString(bool concat, float fontheight, float x, float y, float z, float rotz, unsigned char justificationflags, ColorByte color, Vector2 size, const char* text, ...)
{
    assert( m_pFont && m_pFont->m_pFont );

    if( strlen( text ) == 0 )
        return 0;

    const char* stringtodraw = text;
    if( g_pLanguageTable != 0 && text[0] == '.' )
        stringtodraw = g_pLanguageTable->LookUp( text );

    int numlines = 0;

    if( concat == false )
    {
        ClearText();
    }

    bool moretexttocome = true;
    const char* stringpos = stringtodraw;

    while( moretexttocome )
    {
        numlines++;

        char singlelinebuffer[300];
        singlelinebuffer[0] = 0;
        char* singlelinebufferpos = singlelinebuffer;

        // word wrap if width of text is not 0.
        if( size.x != 0 )
        {
            float linewidth = -1;// = GetStringSize( fontheight, Vector2(0,0), singlelinebuffer ).x;
            while( linewidth < size.x &&
                    *stringpos != 0 )
            {
                *singlelinebufferpos = *stringpos;
                singlelinebufferpos++;
                *singlelinebufferpos = 0;
                stringpos++;

                linewidth = GetStringSize( fontheight, Vector2(0,0), singlelinebuffer ).x;

                assert( singlelinebufferpos < singlelinebuffer + 300 );
            }

            int numcharswewentback = 0;
            while( ( *(singlelinebufferpos-1) != ' ' && *stringpos != 0 ) &&
                    singlelinebufferpos > singlelinebuffer )
            {
                singlelinebufferpos--;
                numcharswewentback++;
            }

            if( singlelinebufferpos != singlelinebuffer )
            {
                *singlelinebufferpos = 0;
                stringpos -= numcharswewentback;
            }

            if( *stringpos == 0 )
                moretexttocome = false;

            stringtodraw = singlelinebuffer;
        }
        else
        {
            moretexttocome = false;
        }
            
        //// don't bother drawing if fontheight is zero... still doing logic above so the currect number of lines will be returned.
        //if( g_pRTQGlobals->m_WordWrapCountLinesOnly )
        //    continue;

        Vertex_XYZUV_RGBA* pVertsToDraw = (Vertex_XYZUV_RGBA*)GetVerts( true );

        int newverts = (int)strlen( stringtodraw ) * 4;
#if _DEBUG
        m_MostLettersAttemptedToDrawThisFrame += newverts/4;
        if( m_MostLettersAttemptedToDrawThisFrame > m_MostLettersAttemptedToDrawEver )
            m_MostLettersAttemptedToDrawEver = m_MostLettersAttemptedToDrawThisFrame;
#endif

        if( m_NumVertsToDraw + newverts > GetNumVerts() )
        {
#if _DEBUG
            LOGInfo( LOGTag, "TextMesh buffer isn't big enough for string (%s) - %d of %d letters used - most letters needed (%d)\n", stringtodraw, m_NumVertsToDraw/4, GetNumVerts()/4, m_MostLettersAttemptedToDrawEver );
#endif
            //assert( false ); // drawing more than we have room for.
            return 0;
        }

        pVertsToDraw += m_NumVertsToDraw;

        unsigned int textstrlen = m_pFont->m_pFont->GenerateVerts( stringtodraw, true, pVertsToDraw, fontheight, GL_TRIANGLES, justificationflags, color );

        m_NumVertsToDraw += (unsigned short)(textstrlen * 4);
        m_NumIndicesToDraw += textstrlen * 6;

        MyMatrix position;
        position.SetIdentity();
        position.Rotate( rotz, 0, 0, 1 );
        position.SetPosition( x, y - (numlines-1)*fontheight, z );
        //position.SetPosition( x, y - (numlines-1)*g_pRTQGlobals->m_WordWrapLineIncSize, z );
        //position.SetPosition( x, y, z );

        for( unsigned int i=0; i<textstrlen*4; i++ )
        {
            Vector3 out = position.TransformVector3( *(Vector3*)&pVertsToDraw[i].x );
            pVertsToDraw[i].x = out.x;
            pVertsToDraw[i].y = out.y;
            pVertsToDraw[i].z = out.z;
        }
    }

    return numlines;
}
Beispiel #26
0
void glTexParameteri(GLenum target, GLenum pname, GLint param)
{
    LOGInfo( LOGTag, "********************************* glTexParameteri() not implemented\n" );
}
Beispiel #27
0
void glBindTexture(GLenum unit, GLenum value)
{
    LOGInfo( LOGTag, "********************************* glBindTexture() not implemented\n" );
}
Beispiel #28
0
void glActiveTexture(GLenum texture)
{
    LOGInfo( LOGTag, "********************************* glActiveTexture() not implemented\n" );
}
Beispiel #29
0
void WebRequestObject::RequestCloseConnection()
{
    LOGInfo( LOGTag, "WebRequestObject::RequestCloseConnection\n" );

    SAFE_DELETE( m_pFileObject );
}
Beispiel #30
0
void glUniform1i(GLint location, GLint64EXT x)
{
    LOGInfo( LOGTag, "********************************* glUniform1i() not implemented\n" );
}