Merge pull request #15852 from MSOpenTech/v3-winrt-x64

V3: updated to support Windows 10 UWP x64 builds
This commit is contained in:
minggo 2016-06-16 11:08:28 +08:00 committed by GitHub
commit ab0e461b00
23 changed files with 73 additions and 151 deletions

View File

@ -499,7 +499,6 @@
<ClInclude Include="$(MSBuildThisFileDirectory)..\..\..\..\platform\winrt\CCFreeTypeFont.h" />
<ClInclude Include="$(MSBuildThisFileDirectory)..\..\..\..\platform\winrt\CCGL.h" />
<ClInclude Include="$(MSBuildThisFileDirectory)..\..\..\..\platform\winrt\CCGLViewImpl-winrt.h" />
<ClInclude Include="$(MSBuildThisFileDirectory)..\..\..\..\platform\winrt\CCGL_Angle.h" />
<ClInclude Include="$(MSBuildThisFileDirectory)..\..\..\..\platform\winrt\CCPlatformDefine-winrt.h" />
<ClInclude Include="$(MSBuildThisFileDirectory)..\..\..\..\platform\winrt\CCPrecompiledShaders.h" />
<ClInclude Include="$(MSBuildThisFileDirectory)..\..\..\..\platform\winrt\CCPThreadWinRT.h" />

View File

@ -676,9 +676,6 @@
<ClInclude Include="$(MSBuildThisFileDirectory)..\..\..\..\platform\winrt\CCGL.h">
<Filter>platform\winrt</Filter>
</ClInclude>
<ClInclude Include="$(MSBuildThisFileDirectory)..\..\..\..\platform\winrt\CCGL_Angle.h">
<Filter>platform\winrt</Filter>
</ClInclude>
<ClInclude Include="$(MSBuildThisFileDirectory)..\..\..\..\platform\winrt\CCPThreadWinRT.h">
<Filter>platform\winrt</Filter>
</ClInclude>

View File

@ -119,40 +119,40 @@
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
<GenerateManifest>false</GenerateManifest>
<IgnoreImportLibrary>false</IgnoreImportLibrary>
<TargetName>libcocos2d_v3.11_Windows_8.1</TargetName>
<TargetName>libcocos2d_v3.12_Windows_8.1</TargetName>
<LinkIncremental>
</LinkIncremental>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
<GenerateManifest>false</GenerateManifest>
<IgnoreImportLibrary>false</IgnoreImportLibrary>
<TargetName>libcocos2d_v3.11_Windows_8.1</TargetName>
<TargetName>libcocos2d_v3.12_Windows_8.1</TargetName>
<LinkIncremental>
</LinkIncremental>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|ARM'">
<GenerateManifest>false</GenerateManifest>
<IgnoreImportLibrary>false</IgnoreImportLibrary>
<TargetName>libcocos2d_v3.11_Windows_8.1</TargetName>
<TargetName>libcocos2d_v3.12_Windows_8.1</TargetName>
<LinkIncremental>false</LinkIncremental>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|ARM'">
<GenerateManifest>false</GenerateManifest>
<IgnoreImportLibrary>false</IgnoreImportLibrary>
<TargetName>libcocos2d_v3.11_Windows_8.1</TargetName>
<TargetName>libcocos2d_v3.12_Windows_8.1</TargetName>
<LinkIncremental>false</LinkIncremental>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
<GenerateManifest>false</GenerateManifest>
<IgnoreImportLibrary>false</IgnoreImportLibrary>
<TargetName>libcocos2d_v3.11_Windows_8.1</TargetName>
<TargetName>libcocos2d_v3.12_Windows_8.1</TargetName>
<LinkIncremental>
</LinkIncremental>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
<GenerateManifest>false</GenerateManifest>
<IgnoreImportLibrary>false</IgnoreImportLibrary>
<TargetName>libcocos2d_v3.11_Windows_8.1</TargetName>
<TargetName>libcocos2d_v3.12_Windows_8.1</TargetName>
<LinkIncremental>
</LinkIncremental>
</PropertyGroup>

View File

@ -91,23 +91,23 @@
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
<GenerateManifest>false</GenerateManifest>
<IgnoreImportLibrary>false</IgnoreImportLibrary>
<TargetName>libcocos2d_v3.11_WindowsPhone_8.1</TargetName>
<TargetName>libcocos2d_v3.12_WindowsPhone_8.1</TargetName>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
<GenerateManifest>false</GenerateManifest>
<IgnoreImportLibrary>false</IgnoreImportLibrary>
<TargetName>libcocos2d_v3.11_WindowsPhone_8.1</TargetName>
<TargetName>libcocos2d_v3.12_WindowsPhone_8.1</TargetName>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|ARM'">
<GenerateManifest>false</GenerateManifest>
<IgnoreImportLibrary>false</IgnoreImportLibrary>
<TargetName>libcocos2d_v3.11_WindowsPhone_8.1</TargetName>
<TargetName>libcocos2d_v3.12_WindowsPhone_8.1</TargetName>
<LinkIncremental>false</LinkIncremental>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|ARM'">
<GenerateManifest>false</GenerateManifest>
<IgnoreImportLibrary>false</IgnoreImportLibrary>
<TargetName>libcocos2d_v3.11_WindowsPhone_8.1</TargetName>
<TargetName>libcocos2d_v3.12_WindowsPhone_8.1</TargetName>
<LinkIncremental>false</LinkIncremental>
</PropertyGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">

View File

@ -1233,7 +1233,6 @@
<ClInclude Include="..\..\platform\winrt\CCFreeTypeFont.h" />
<ClInclude Include="..\..\platform\winrt\CCGL.h" />
<ClInclude Include="..\..\platform\winrt\CCGLViewImpl-winrt.h" />
<ClInclude Include="..\..\platform\winrt\CCGL_Angle.h" />
<ClInclude Include="..\..\platform\winrt\CCPlatformDefine-winrt.h" />
<ClInclude Include="..\..\platform\winrt\CCPrecompiledShaders.h" />
<ClInclude Include="..\..\platform\winrt\CCPThreadWinRT.h" />
@ -1535,34 +1534,34 @@
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
<GenerateManifest>false</GenerateManifest>
<IgnoreImportLibrary>false</IgnoreImportLibrary>
<TargetName>libcocos2d_v3.11_Windows_10.0</TargetName>
<TargetName>libcocos2d_v3.12_Windows_10.0</TargetName>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
<GenerateManifest>false</GenerateManifest>
<IgnoreImportLibrary>false</IgnoreImportLibrary>
<TargetName>libcocos2d_v3.11_Windows_10.0</TargetName>
<TargetName>libcocos2d_v3.12_Windows_10.0</TargetName>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|ARM'">
<GenerateManifest>false</GenerateManifest>
<IgnoreImportLibrary>false</IgnoreImportLibrary>
<LinkIncremental>false</LinkIncremental>
<TargetName>libcocos2d_v3.11_Windows_10.0</TargetName>
<TargetName>libcocos2d_v3.12_Windows_10.0</TargetName>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|ARM'">
<GenerateManifest>false</GenerateManifest>
<IgnoreImportLibrary>false</IgnoreImportLibrary>
<LinkIncremental>false</LinkIncremental>
<TargetName>libcocos2d_v3.11_Windows_10.0</TargetName>
<TargetName>libcocos2d_v3.12_Windows_10.0</TargetName>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
<GenerateManifest>false</GenerateManifest>
<IgnoreImportLibrary>false</IgnoreImportLibrary>
<TargetName>libcocos2d_v3.11_Windows_10.0</TargetName>
<TargetName>libcocos2d_v3.12_Windows_10.0</TargetName>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
<GenerateManifest>false</GenerateManifest>
<IgnoreImportLibrary>false</IgnoreImportLibrary>
<TargetName>libcocos2d_v3.11_Windows_10.0</TargetName>
<TargetName>libcocos2d_v3.12_Windows_10.0</TargetName>
</PropertyGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
<ClCompile>

View File

@ -3425,9 +3425,6 @@
<ClInclude Include="..\..\platform\winrt\CCGL.h">
<Filter>platform\winrt</Filter>
</ClInclude>
<ClInclude Include="..\..\platform\winrt\CCGL_Angle.h">
<Filter>platform\winrt</Filter>
</ClInclude>
<ClInclude Include="..\..\platform\winrt\CCGLViewImpl-winrt.h">
<Filter>platform\winrt</Filter>
</ClInclude>

View File

@ -116,7 +116,7 @@ void Audio::CreateResources()
unsigned int Audio::Hash(const char *key)
{
unsigned int len = strlen(key);
unsigned int len = static_cast<unsigned int>(strlen(key));
const char *end=key+len;
unsigned int hash;
@ -505,7 +505,7 @@ void Audio::PreloadSoundEffect(const char* pszFilePath, bool isMusic)
}
m_soundEffects[sound].m_soundID = sound;
uint32 bufferLength = reader->getTotalAudioBytes();
size_t bufferLength = reader->getTotalAudioBytes();
WAVEFORMATEX wfx = reader->getWaveFormatInfo();
cocos2d::experimental::AudioDataChunk chunk;
@ -560,7 +560,7 @@ void Audio::PreloadSoundEffect(const char* pszFilePath, bool isMusic)
// Queue in-memory buffer for playback
ZeroMemory(&m_soundEffects[sound].m_audioBuffer, sizeof(m_soundEffects[sound].m_audioBuffer));
m_soundEffects[sound].m_audioBuffer.AudioBytes = m_soundEffects[sound].m_soundEffectBufferLength;
m_soundEffects[sound].m_audioBuffer.AudioBytes = static_cast<UINT32>(m_soundEffects[sound].m_soundEffectBufferLength);
m_soundEffects[sound].m_audioBuffer.pAudioData = m_soundEffects[sound].m_soundEffectBufferData;
m_soundEffects[sound].m_audioBuffer.pContext = &m_soundEffects[sound];
m_soundEffects[sound].m_audioBuffer.Flags = XAUDIO2_END_OF_STREAM;

View File

@ -30,7 +30,7 @@ struct SoundEffectData
IXAudio2SourceVoice* m_soundEffectSourceVoice;
XAUDIO2_BUFFER m_audioBuffer;
byte* m_soundEffectBufferData;
uint32 m_soundEffectBufferLength;
size_t m_soundEffectBufferLength;
uint32 m_soundEffectSampleRate;
bool m_soundEffectStarted;
bool m_soundEffectPaused;

View File

@ -489,7 +489,7 @@ bool AudioPlayer::submitBuffers()
if (!_cachedBufferQ.size() || (_isStreaming && _cachedBufferQ.size() < QUEUEBUFFER_NUM)) {
AudioDataChunk chunk;
if (_cache->getChunk(chunk) && chunk._dataSize) {
_xaBuffer.AudioBytes = chunk._dataSize;
_xaBuffer.AudioBytes = static_cast<UINT32>(chunk._dataSize);
_xaBuffer.pAudioData = chunk._data->data();
_xaBuffer.Flags = chunk._endOfStream ? XAUDIO2_END_OF_STREAM : 0;
_cachedBufferQ.push(chunk);

View File

@ -103,7 +103,7 @@ bool WAVReader::initialize(const std::string& filePath)
_streamer->Initialize(StringUtf8ToWideChar(_filePath).c_str(), true);
_wfx = _streamer->GetOutputWaveFormatEx();
UINT32 dataSize = _streamer->GetMaxStreamLengthInBytes();
size_t dataSize = _streamer->GetMaxStreamLengthInBytes();
if (dataSize <= 0)
break;
@ -146,7 +146,7 @@ bool WAVReader::consumeChunk(AudioDataChunk& chunk)
void WAVReader::produceChunk()
{
_rwMutex.lock();
int chunkSize = _audioSize;
size_t chunkSize = _audioSize;
do {
if (!_isStreaming && _chnkQ.size() || _chnkQ.size() >= QUEUEBUFFER_NUM) {
@ -167,10 +167,10 @@ void WAVReader::produceChunk()
break;
}
UINT retSize = 0;
unsigned int retSize = 0;
AudioDataChunk chunk = { 0 };
chunk._data = std::make_shared<PCMBuffer>(chunkSize);
_streamer->ReadChunk(chunk._data->data(), _bytesRead, chunkSize, &retSize);
_streamer->ReadChunk(chunk._data->data(), static_cast<unsigned int>(_bytesRead), static_cast<unsigned int>(chunkSize), &retSize);
_bytesRead += retSize;
chunk._dataSize = retSize;
chunk._seqNo = ((float)_bytesRead / _audioSize) * ((float)_audioSize / CHUNK_SIZE_MAX);
@ -259,7 +259,7 @@ bool MP3Reader::consumeChunk(AudioDataChunk& chunk)
void MP3Reader::produceChunk()
{
_rwMutex.lock();
int chunkSize = _audioSize;
size_t chunkSize = _audioSize;
do {
if (!_isStreaming && _chnkQ.size() || _chnkQ.size() >= QUEUEBUFFER_NUM) {
@ -430,7 +430,7 @@ void MP3Reader::chunkify(PCMBuffer& buffer)
if (buffer.size() && _chnkQ.size() < QUEUEBUFFER_NUM)
{
AudioDataChunk chunk = { 0 };
int chunkSize = buffer.size();
size_t chunkSize = buffer.size();
chunk._data = std::make_shared<PCMBuffer>(buffer);
_bytesRead += chunkSize;
chunk._dataSize = chunkSize;
@ -459,14 +459,14 @@ bool MP3Reader::appendToMappedWavFile(PCMBuffer& buffer)
break;
}
ret = (TRUE == WriteFile(file.Get(), buffer.data(), buffer.size(), nullptr, nullptr));
ret = (TRUE == WriteFile(file.Get(), buffer.data(), static_cast<DWORD>(buffer.size()), nullptr, nullptr));
} while (false);
_rwMutex.unlock();
return ret;
}
void MP3Reader::readFromMappedWavFile(BYTE *data, size_t offset, int size, UINT *pRetSize)
void MP3Reader::readFromMappedWavFile(BYTE *data, size_t offset, size_t size, UINT *pRetSize)
{
do {
auto file = openFile(_mappedWavFile);
@ -483,7 +483,7 @@ void MP3Reader::readFromMappedWavFile(BYTE *data, size_t offset, int size, UINT
}
}
ReadFile(file.Get(), data, size, (LPDWORD)pRetSize, nullptr);
ReadFile(file.Get(), data, static_cast<DWORD>(size), (LPDWORD)pRetSize, nullptr);
} while (false);
}
@ -581,7 +581,7 @@ bool OGGReader::consumeChunk(AudioDataChunk& chunk)
void OGGReader::produceChunk()
{
_rwMutex.lock();
int chunkSize = _audioSize;
size_t chunkSize = _audioSize;
do {
if (!_isStreaming && _chnkQ.size() || _chnkQ.size() >= QUEUEBUFFER_NUM) {
@ -615,7 +615,7 @@ void OGGReader::produceChunk()
{
long br = 0;
int current_section = 0;
if ((br = ov_read(_vorbisFd.get(), (char*)chunk._data->data() + retSize, chunkSize - retSize, 0, 2, 1, &current_section)) == 0) {
if ((br = ov_read(_vorbisFd.get(), (char*)chunk._data->data() + retSize, static_cast<int>(chunkSize) - retSize, 0, 2, 1, &current_section)) == 0) {
break;
}
retSize += br;

View File

@ -37,9 +37,9 @@
NS_CC_BEGIN
namespace experimental{
const UINT PCMDATA_CACHEMAXSIZE = 2621440;
const UINT QUEUEBUFFER_NUM = 4;
const UINT CHUNK_SIZE_MAX = PCMDATA_CACHEMAXSIZE / QUEUEBUFFER_NUM;
const size_t PCMDATA_CACHEMAXSIZE = 2621440;
const size_t QUEUEBUFFER_NUM = 4;
const size_t CHUNK_SIZE_MAX = PCMDATA_CACHEMAXSIZE / QUEUEBUFFER_NUM;
typedef std::vector<BYTE> PCMBuffer;
@ -127,7 +127,7 @@ class MP3Reader : public AudioSourceReader
HRESULT readAudioData(IMFSourceReader* pReader);
void chunkify(PCMBuffer& buffer);
bool appendToMappedWavFile(PCMBuffer& buffer);
void readFromMappedWavFile(BYTE *data, size_t offset, int size, UINT *pRetSize);
void readFromMappedWavFile(BYTE *data, size_t offset, size_t size, UINT *pRetSize);
Microsoft::WRL::Wrappers::FileHandle openFile(const std::string& path, bool append = false);
private:

View File

@ -99,7 +99,7 @@ Platform::Array<byte>^ MediaStreamer::ReadData(_In_ Platform::String^ filename,
throw ref new Platform::OutOfMemoryException();
}
from += m_offset;
from += static_cast<unsigned int>(m_offset);
length = (length == 0 || from + length > fileInfo.EndOfFile.LowPart) ? fileInfo.EndOfFile.LowPart - from : length;
Platform::Array<byte>^ fileData = ref new Platform::Array<byte>(length);
@ -215,11 +215,11 @@ void MediaStreamer::ReadAll(uint8* buffer, uint32 maxBufferSize, uint32* bufferL
{
if (!m_data.size())
{
ReadChunk(buffer, 0, m_dataLen, bufferLength);
ReadChunk(buffer, 0, static_cast<unsigned int>(m_dataLen), bufferLength);
}
else
{
UINT32 toCopy = m_data.size() - m_offset;
UINT32 toCopy = static_cast<UINT32>(m_data.size() - m_offset);
if (toCopy > maxBufferSize) toCopy = maxBufferSize;
CopyMemory(buffer, m_data.data(), toCopy);

View File

@ -28,8 +28,8 @@ private:
WAVEFORMATEX m_waveFormat;
uint32 m_maxStreamLengthInBytes;
std::vector<byte> m_data;
UINT32 m_offset;
UINT32 m_dataLen;
size_t m_offset;
size_t m_dataLen;
Platform::String^ m_filename;
Platform::Array<byte>^ ReadData(_In_ Platform::String^ filename);
@ -50,7 +50,7 @@ internal:
return m_waveFormat;
}
UINT32 GetMaxStreamLengthInBytes()
size_t GetMaxStreamLengthInBytes()
{
return m_dataLen;
}

View File

@ -179,7 +179,7 @@ unsigned char* CCFreeTypeFont::initWithString(const char * text, const FontDefin
unsigned char* CCFreeTypeFont::getBitmap(Device::TextAlign eAlignMask, int &width, int &height, ssize_t& dataLength)
{
int lineNumber = 0;
int totalLines = m_lines.size();
int totalLines = static_cast<int>(m_lines.size());
m_width = m_inWidth ? m_inWidth : m_textWidth;
m_height = m_inHeight ? m_inHeight : m_textHeight;
@ -463,7 +463,7 @@ FT_Error CCFreeTypeFont::initWordGlyphs(std::vector<TGlyph>& glyphs, const std::
unsigned int numGlyphs = 0;
wchar_t * pwszBuffer = nullptr;
int num_chars = text.size();
int num_chars = static_cast<int>(text.size());
int nBufLen = num_chars + 1;
pwszBuffer = new wchar_t[nBufLen];
if(!pwszBuffer)

View File

@ -38,10 +38,15 @@ THE SOFTWARE.
#include "GLES2/gl2ext.h"
#include "GLES3/gl3.h"
#define glClearDepth glClearDepthf
#define glDeleteVertexArrays glDeleteVertexArraysOES
#define glGenVertexArrays glGenVertexArraysOES
#define glBindVertexArray glBindVertexArrayOES
#define glMapBuffer glMapBufferOES
#define glUnmapBuffer glUnmapBufferOES
#define GL_WRITE_ONLY GL_WRITE_ONLY_OES
#else
#include "platform/winrt/CCGL_Angle.h"
#endif

View File

@ -259,7 +259,7 @@ void GLViewImpl::OnPointerPressed(CoreWindow^ sender, PointerEventArgs^ args)
void GLViewImpl::OnPointerPressed(PointerEventArgs^ args)
{
int id = args->CurrentPoint->PointerId;
intptr_t id = args->CurrentPoint->PointerId;
Vec2 pt = GetPoint(args);
handleTouchesBegin(1, &id, &pt.x, &pt.y);
}
@ -267,7 +267,7 @@ void GLViewImpl::OnPointerPressed(PointerEventArgs^ args)
void GLViewImpl::OnPointerWheelChanged(CoreWindow^ sender, PointerEventArgs^ args)
{
float direction = (float)args->CurrentPoint->Properties->MouseWheelDelta;
int id = 0;
intptr_t id = 0;
Vec2 p(0.0f,0.0f);
handleTouchesBegin(1, &id, &p.x, &p.y);
p.y += direction;
@ -297,7 +297,7 @@ void GLViewImpl::OnPointerMoved( PointerEventArgs^ args)
{
if (m_lastPointValid)
{
int id = args->CurrentPoint->PointerId;
intptr_t id = args->CurrentPoint->PointerId;
Vec2 p = GetPoint(args);
handleTouchesMove(1, &id, &p.x, &p.y);
}
@ -317,7 +317,7 @@ void GLViewImpl::OnPointerReleased(CoreWindow^ sender, PointerEventArgs^ args)
void GLViewImpl::OnPointerReleased(PointerEventArgs^ args)
{
int id = args->CurrentPoint->PointerId;
intptr_t id = args->CurrentPoint->PointerId;
Vec2 pt = GetPoint(args);
handleTouchesEnd(1, &id, &pt.x, &pt.y);
}

View File

@ -1,78 +0,0 @@
/****************************************************************************
Copyright (c) 2010 cocos2d-x.org
Copyright (c) Microsoft Open Technologies, Inc.
http://www.cocos2d-x.org
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in
all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
THE SOFTWARE.
****************************************************************************/
#ifndef __CCGL_ANGLE_H__
#define __CCGL_ANGLE_H__
// disable unimplemented function declarations in Angle
#define GL_OES_mapbuffer 1
#define GL_OES_vertex_array_object 1
#include "EGL/egl.h"
#include "EGL/eglext.h"
#include "EGL/eglplatform.h"
#include "GLES2/gl2.h"
#include "GLES2/gl2ext.h"
#include "winrtangle.h"
#include "esUtil.h"
#include "base/ccMacros.h"
#define GL_WRITE_ONLY_OES 0x88B9
#define GL_BUFFER_ACCESS_OES 0x88BB
#define GL_BUFFER_MAPPED_OES 0x88BC
#define GL_BUFFER_MAP_POINTER_OES 0x88BD
inline void glGenVertexArrays(GLsizei n, GLuint *arrays)
{
CCASSERT(false, "AngleProject does not implement glGenVertexArraysOES");
}
inline void glBindVertexArray(GLuint array)
{
CCASSERT(false, "AngleProject does not implement glBindVertexArrayOES");
}
inline void glDeleteVertexArrays(GLsizei n, const GLuint *arrays)
{
CCASSERT(false, "AngleProject does not implement glDeleteVertexArraysOES");
}
inline void* glMapBuffer(GLenum target, GLenum access)
{
CCASSERT(false, "AngleProject does not implement glMapBufferOES");
return NULL;
}
inline GLboolean glUnmapBuffer(GLenum targets)
{
CCASSERT(false, "AngleProject does not implement glUnmapBufferOES");
return false;
}
#define GL_DEPTH24_STENCIL8 GL_DEPTH24_STENCIL8_OES
#endif // __CCGL_ANGLE_H__

View File

@ -83,16 +83,16 @@ static std::string computeHash(const GLchar* vShaderByteArray, const GLchar* fSh
if(!err)
{
err = SHA1Input(&sha,(const unsigned char *) vShaderByteArray,strlen(vShaderByteArray));
err = SHA1Input(&sha,(const unsigned char *) vShaderByteArray,static_cast<unsigned int>(strlen(vShaderByteArray)));
}
if(!err)
{
err = SHA1Input(&sha,(const unsigned char *) fShaderByteArray,strlen(fShaderByteArray));
err = SHA1Input(&sha,(const unsigned char *) fShaderByteArray, static_cast<unsigned int>(strlen(fShaderByteArray)));
}
if(!err)
{
char* shader_version = (char*) glGetString(GL_SHADING_LANGUAGE_VERSION);
err = SHA1Input(&sha,(const unsigned char *) shader_version,strlen(shader_version));
err = SHA1Input(&sha,(const unsigned char *) shader_version, static_cast<unsigned int>(strlen(shader_version)));
}
if(!err)
{

View File

@ -153,7 +153,7 @@ std::string PlatformStringToString(Platform::String^ s) {
Platform::String^ PlatformStringFromString(const std::string& s)
{
std::wstring ws = StringUtf8ToWideChar(s);
return ref new Platform::String(ws.data(), ws.length());
return ref new Platform::String(ws.data(), static_cast<unsigned int>(ws.length()));
}
#if 0

View File

@ -107,7 +107,7 @@ bool WICImageLoader::decodeImageData(ImageBlob blob, size_t size)
if(SUCCEEDED(hr))
{
hr = pWicStream->InitializeFromMemory((BYTE*)blob, size);
hr = pWicStream->InitializeFromMemory((BYTE*)blob, static_cast<DWORD>(size));
}
IWICBitmapDecoder* pDecoder = NULL;
@ -172,11 +172,11 @@ bool WICImageLoader::processImage(IWICBitmapDecoder* pDecoder)
if(NULL != pConv)
{
hr = pConv->CopyPixels(NULL, rowPitch, _dataLen, _data);
hr = pConv->CopyPixels(NULL, static_cast<UINT>(rowPitch), static_cast<UINT>(_dataLen), _data);
}
else
{
hr = pFrame->CopyPixels(NULL, rowPitch, _dataLen, _data);
hr = pFrame->CopyPixels(NULL, static_cast<UINT>(rowPitch), static_cast<UINT>(_dataLen), _data);
}
}
@ -287,7 +287,7 @@ int WICImageLoader::getWidth()
return _width;
}
int WICImageLoader::getImageData(ImageBlob rawData, size_t dataLen)
size_t WICImageLoader::getImageData(ImageBlob rawData, size_t dataLen)
{
if(dataLen < _dataLen)
return 0;
@ -297,7 +297,7 @@ int WICImageLoader::getImageData(ImageBlob rawData, size_t dataLen)
return _dataLen;
}
int WICImageLoader::getImageDataSize()
size_t WICImageLoader::getImageDataSize()
{
return _dataLen;
}
@ -363,7 +363,7 @@ bool WICImageLoader::encodeImageData(std::string path, const unsigned char* data
size_t bpp = getBitsPerPixel(pixelFormat);
size_t stride = (width * bpp + 7) / 8;
hr = pFrame->WritePixels(height, stride, dataLen, (BYTE*)data);
hr = pFrame->WritePixels(height, static_cast<UINT>(stride), static_cast<UINT>(dataLen), (BYTE*)data);
}
if (SUCCEEDED(hr)) {

View File

@ -58,9 +58,9 @@ public:
int getWidth();
int getHeight();
int getImageDataSize();
size_t getImageDataSize();
WICPixelFormatGUID getPixelFormat();
int getImageData(ImageBlob rawData, size_t dataLen);
size_t getImageData(ImageBlob rawData, size_t dataLen);
bool decodeImageData(ImageBlob data, size_t dataLen);
bool encodeImageData(std::string path, const unsigned char* data, size_t dataLen, WICPixelFormatGUID pixelFormat, int width, int height, GUID containerFormat);
@ -75,7 +75,7 @@ private:
int _height;
int _width;
size_t _dataLen;
UINT _bpp;
size_t _bpp;
WICPixelFormatGUID _format;
BYTE* _data;

View File

@ -1,6 +1,6 @@
<?xml version="1.0" encoding="utf-8"?>
<Package xmlns="http://schemas.microsoft.com/appx/manifest/foundation/windows10" xmlns:mp="http://schemas.microsoft.com/appx/2014/phone/manifest" xmlns:uap="http://schemas.microsoft.com/appx/manifest/uap/windows10" IgnorableNamespaces="uap mp">
<Identity Name="a1302056-0aa8-48d3-a3df-29e1aa59004b" Publisher="CN=stamm" Version="1.0.0.0" />
<Identity Name="CE539A5B-63FE-46C6-8174-29078A5D8DC3" Publisher="CN=stamm" Version="1.0.0.0" />
<mp:PhoneIdentity PhoneProductId="a1302056-0aa8-48d3-a3df-29e1aa59004b" PhonePublisherId="00000000-0000-0000-0000-000000000000" />
<Properties>
<DisplayName>cpp-tests</DisplayName>

View File

@ -126,6 +126,9 @@
<PropertyGroup>
<PackageCertificateKeyFile>cpp-tests_TemporaryKey.pfx</PackageCertificateKeyFile>
<PackageCertificateThumbprint>F3187E657336E152D7AC4C352643738EE7C7C055</PackageCertificateThumbprint>
<AppxAutoIncrementPackageRevision>False</AppxAutoIncrementPackageRevision>
<AppxBundle>Always</AppxBundle>
<AppxBundlePlatforms>x86</AppxBundlePlatforms>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
<LinkIncremental>false</LinkIncremental>
@ -659,4 +662,4 @@
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
<ImportGroup Label="ExtensionTargets">
</ImportGroup>
</Project>
</Project>