Commit Graph

53 Commits

Author SHA1 Message Date
Sergey Shambir d23d486720 Linux: added SDL2 backend as replacement for GLFW.
Initially planned as alternative, made replacement after discussion with
minggo.

Summary:
GLFW v.3 released in June. New version breaks API without real need:
http://cocos2d-x.org/boards/6/topics/31277
Meanwhile SDL2 is very stable. SDL2 used in Steam Runtime and will be
part of Ubuntu SDK, it's supported by other distributions.

Completed:
- OpenGL initialization and window handling with SDL
- Keyboard, IME emulation, mouse and touches support with SDL
- Window title now contains app name on Linux
- Backspace correctly handled with new backend

Note:
- SDL on X11 have no proper multitouch, but backend handles multitouch
events to support future Linux graphics.
2013-07-30 23:08:26 +04:00
James Chen e16a5f469b issue #2430: Refactoring enum 'ResolutionPolicy'. 2013-07-26 18:18:58 +08:00
Ricardo Quesada 89d210bdb3 CCAssert -> CCASSERT
and other best pracitces like:

capacity and "index" are ints and not unsigned int (google's recomendation).
 It is easier to detect underflow bugs like this

plus other minor improvements
2013-07-19 22:01:27 -07:00
minggo 6abe6fce78 closed #2393: fix conflicts 2013-07-12 18:04:32 +08:00
minggo 5d9fea1416 issue #2393:mark PointZero RectZero and SizeZero as deprecated 2013-07-12 14:47:36 +08:00
minggo 15096b0716 issue #2393:mark CCPointMake CCSizeMake CCRectMake as deprecated 2013-07-12 14:30:26 +08:00
Ricardo Quesada cf262c28e2 getInstance() / destroyInstance() are used...
... instead of sharedXXX / purgeXXX.
They are more C++ friendly, and also easier to remember.

common files + Mac files + iOS files + tests/samples files were updated.

The old methods are deprecated now.
2013-07-11 15:24:23 -07:00
James Chen 93b6328303 issue #2129: Removing CC prefix for cocos2dx module. 2013-06-20 14:13:12 +08:00
James Chen c0d44cb2e4 fixed #2129: Rename m_iVar to _var, remove CC prefixes. 2013-06-15 14:03:30 +08:00
James Chen ec8ab8bd8b Updating multi-platform-xxx template for win32. 2013-06-07 12:57:28 +08:00
James Chen 612a8a309f Merge pull request #2193 from Weeds/feature-screen-dimensions
fixed #2065: Adding kResolutionFixedHeight and kResolutionFixedWidth resolution policy.
2013-04-18 00:31:13 -07:00
sjchao 4690a45f3e change a method name
change method name from isScissorEnable() to isScissorEnabled() in
class CCEGLViewProtocal
2013-03-29 17:19:47 +08:00
sjchao 18c43e29b2 change method name from getIsScissorEnable() to isScissorEnable() 2013-03-29 15:32:30 +08:00
chao 253ebe49e4 add getIsScissorEnable() and getScissorRect() for CCEGLViewProtocal 2013-03-29 01:28:26 +08:00
Andre Rudlaff 865a730ef5 added kResolutionFixedHeight and kResolutionFixedWidth resolution policy
These new resolution policies will either ignore the width or height of the
specified design resolution size, but scale the ignored dimension, so it
matches the aspect ratio of the device.

Example:
A device with 854x480 pixels and a design resolution size set to 480x320
and the kResolutionFixedHeight policy, will create an internal canvas of
the size of 570x320px
If the device original size is 800x480 its internal size will be
534x320px
The height for both examples stays the same, the width is adjusted to match
the aspect ratio

Benefits:
- no distortions
- full canvas is usable, the visibility origin is 0/0
- I can use getWinSize() to place objects which is more intuitive
- for objects that should be placed at 0/0 I can use CGPointZero or 0/0 instead
  of the VisibilityRect methods, which is more readable
- using this method projects from the 1.x branch are probably much easier to
  port

Disadvantages:
- it is the developers responsibility to create the game code so that it
  supports multiple aspect ratios
2013-03-18 20:06:01 +01:00
Sam Clegg 38878b084b Fix all compiler warnings produced by gcc.
This allows the linux and NaCl builds (and perhaps others)
to be compiles with -Wall and -Werror, and it makes the build
output much less noisy.
2013-03-05 17:01:00 -08:00
James Chen f4f63fd824 fixed #1520: Added comments for using multiresolution in HelloCpp. 2012-10-23 10:50:47 +08:00
James Chen 549dd92d8e fixed #1516: The font size of labels for displaying FPS,SPF,DrawCount is incorrect in different design resolutions. 2012-10-18 15:53:08 +08:00
johnangel a2e1400402 Merge remote branch 'upstream/gles20' into gles20 2012-10-16 08:42:30 +02:00
James Chen 6cf602ea3b issue #1486: CCDirector::getWinSizeInPixel return 'winSize* CC_CONTENT_SCALE_FACTOR()'. This change fixes the wrong display bug in CCRenderTexture. 2012-10-13 10:18:03 +08:00
James Chen e1c0ea761b issue #1486: Removed some unused codes, made it works on WINDOWS. 2012-10-12 09:58:42 +08:00
James Chen cdf54a872f issue #1486: A bug fix. 2012-10-11 17:02:27 +08:00
johnangel 72aa46afe5 Refactoring code 2012-10-08 18:38:04 +02:00
johnangel ad7dacc281 Merge remote branch 'upstream/gles20' into gles20 2012-10-08 16:35:43 +02:00
Sergey Vikhirev 05eb4352e8 Remove retina specific methods and logic 2012-09-24 14:22:02 +04:00
johnangel 778f663e76 Returning setViewName to be able to set game window title 2012-09-19 19:56:58 +02:00
johnangel acac470f7b Fixing GPF when old OpenGL version is detected 2012-09-19 19:36:09 +02:00
Donald Alan Morrison 216ebab0e1 Minor English Spelling Corrections, etc. 2012-09-15 14:19:14 -07:00
James Chen d6e1d6b4fa Commented some codes. 2012-08-29 21:50:09 +08:00
James Chen 369eb3daa3 [WIN32] Enabled retina. Updated the implementation of fullPathFromRelativePath. 2012-08-24 18:01:16 +08:00
James Chen 0861877594 kCCResolutionXXX -> kResolutionXXX and estimate whether touch point is contained in GL viewport rectangle. 2012-08-20 16:32:22 +08:00
James Chen 63888a7eb5 issue #1432: MutiTouchTest crashes on IOS if putting more than 5 fingers on the screen. 2012-08-20 10:38:21 +08:00
James Chen 0fce637ec7 issue #1429: First commit CCEditBox support, only valid on IOS. PLZ refer to ExtensionsTest/EditBoxTest. 2012-08-15 14:33:56 +08:00
minggo c34812567f issue #1405: modify macro names and comment and add getVisibleSize and getVisibleOrigin in CCDirector 2012-08-09 10:23:39 +08:00
minggo f6115d5667 issue #1405:zoom out work ok 2012-08-07 18:24:45 +08:00
minggo 5d8f909af4 issue #1405:multi resolution works ok 2012-08-07 14:29:46 +08:00
minggo 426a52447d issue #1405:correct touch coordinate when enable retina with retina supportted device 2012-08-01 18:44:10 +08:00
minggo 0b2396c54b issue #1405:support three type of resolution 2012-08-01 16:56:12 +08:00
minggo 90448ec7d0 issue #1269:fix some compiling error because of including error header files 2012-06-19 16:20:46 +08:00
minggo b4899ae46d issue #1310: synchronize CCLabelTTF 2012-06-11 14:36:25 +08:00
James Chen 2238db301b fixed #1301: CCEGLView::sharedOpenGLView().setScissorInPoints() should apply scissor in points. 2012-06-06 14:13:40 +08:00
James Chen ad50d6ee57 fixed #1270: Fixed some warning on win32. 2012-05-29 17:11:33 +08:00
Walzer 1e732930b7 fixed #1258, testjs and spidermonkey-ios is merged. But only test_actions.js works. 2012-05-24 17:48:05 +08:00
James Chen c7359ba1a0 fixed #1252: Added CCEGLViewProtocol::getFrameSize() method for getting the real screen size of device. 2012-05-23 11:57:43 +08:00
James Chen 7cdb11b668 fixed #1215: fixed a bug in retina support for win32. 2012-05-03 15:05:19 +08:00
James Chen 5fc72581cb issue #1204: Removed CCApplication::initInstance. 2012-05-02 17:50:26 +08:00
James Chen edfb8c1f9c issue #1190: used std::string as key of CCDictionary. Updated CCString.pkg, CCArray.pkg, CCDictionary.pkg. 2012-04-26 11:39:49 +08:00
James Chen af86a52f27 issue #1177:Updated some files for ios port. 2012-04-23 15:40:46 +08:00
James Chen 5b77e6e80e Merge branch 'iss1177_platform' of https://github.com/dumganhar/cocos2d-x into iss1177_platform
Conflicts:
	cocos2dx/platform/CCEGLViewProtocol.cpp
	cocos2dx/platform/CCEGLViewProtocol.h
2012-04-23 14:39:27 +08:00
James Chen 24515f009e issue #1177: Updated ios project configuration. 2012-04-23 14:35:41 +08:00