Giter Club home page Giter Club logo

pxcore's Introduction

pxCore

pxCore is a small open source library that provides a portable framebuffer and windowing abstraction for C++. This library is intended to hide the complexity of writing rasterization code on multiple platforms and allows you to easily write the following sorts of things in a portable way:

  • 2d and 3d rasterizers
  • Transition Libraries
  • Filter Routines
  • Image Processing

In its design, a few principles were followed:

  • Be Small – A simple windowed application can be built (on Windows) in as little as 8k.
  • Be Simple – The framebuffer abstraction supports 32bpp framebuffers and is intended to be minimal yet complete.
  • Don’t tightly couple the framebuffer and windowing functionality. Some other framebuffer libraries (eg. PixelToaster) don’t separate out the framebuffer abstraction from the windowing abstraction. By loosely coupling the two abstractions, this library becomes much more valuable. The framebuffer functionality can be used and integrated with other windowing toolkits easily, making YOUR code more reusable.
  • Platform native surface construction
  • Policy free resizing support – No policy is baked into the window resizing support so that applications completely control their own resizing behavior.
  • Portable Keyboard, Mouse and Window events
  • Support for portable performance timers
  • Basic Animation Support - Support for a basic animation timer event (frames per second) is built into the windowing abstraction, making it easy to write applications that animate their contents.
  • pxCore has been ported to Windows, pocketpc (arm4), linux(x11), and OSX.

The most popular usage of pxCore is pxscene. pxscene is an application engine that exposes a scene graph API to a Javascript engine. It gives JavaScript applications access to the pxscene API for visual elements that can be used for composition. pxscene is written on top of pxCore.

pxscene:

  • supports rich animation and alpha masking primitives
  • exposes a DOM-like programming model
  • supports promises for asynchronous behaviors
  • uses W3C event bubbling semantics

pxscene source code is in pxCore/examples/pxScene2d. Instructions for building pxscene are here: Building pxscene Instructions for debugging pxscene JavaScript applications using VSCode are here: Debugging applications

pxcore's People

Contributors

aj-amitjain avatar andrewbenton avatar arun-govindan avatar ashwinikalokhe avatar binbaraj avatar binuinbaraj avatar cjalmeida avatar conniefry avatar dwrobel avatar emutavchi avatar fitzerirl avatar gavriliuk avatar gladish avatar jeffwannamaker avatar jmgasper avatar johnrobinsn avatar kannanmadanagopalt avatar madanagopalt avatar madanagopaltcomcast avatar madanagopalthirumalai avatar madanwork avatar manuduggal avatar mfiess avatar npoltorapavlo avatar ptrekels avatar sborushevsky avatar ssureshmsc avatar tjcarroll2 avatar vertexodessa avatar vivekarumugam avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

pxcore's Issues

Pixi Examples - Lighting demo

The lighting demo for pixi.js doesn't render properly in pxscene. We need to investigate and update accordingly.

Browser

screen shot 2017-04-24 at 4 53 18 pm

pxscene

screen shot 2017-04-24 at 4 53 24 pm

Windows build - V8 inspector usage

From the client below. You should update the project and files accordingly, while still making sure that all proper debugging works as expected

V8 inspector: We already have it included as part of the node external; 
why is V8 inspector in the VS project? It should be removed and used from the externals.

Pixi Examples - Graphics demo

The graphics demo isn't properly rendering in the latest pxscene built from the _topcoder_graphics_and_text_updates.

This was fixed previously, but seems to have regressed. The original patch file for this is attached.

The goal is for this example to render the same in pxscene as it does in a browser:

http://pxscene-pixi-examples.herokuapp.com/demos/graphics-demo.js

The original challenge was here:

https://www.topcoder.com/challenge-details/30056781/?type=develop&noncache=true

And the winning submission is here:

submission-516783-extend-pxcore (1).zip

Pixi Examples - Small text demo differences

demos/text-demo.js is improved over the base code, but it still doesn't match "perfectly"

-- see red and blue arrows in the side-by-side comparison
The red arrows are examples of the stroke not matching, the purple arrows of the spacing not matching.

text - pixijs examples 2017-04-09 21-18-46

Fix hacks

In the previous implementation, a couple hacks were added due to a time crunch. We need to fix these items and revert the changes made back to what they were pre-duktape:

  • Commented out delete this in *Ref (possible heap corruptions)
  • replaced uint32_t with uint16_t in RtIObject::Get(i,...) - There were strange issues that sometimes these overload versions were chose arbitrarily
    • RtIObject::Get(uint32_t
    • RtIObject::Get(const char *

Pixi Examples - Textured Mesh

The Textured Mesh demo is quite a bit different in pxscene vs. the browser. We need to add functionality (if possible) to support this demo so that it matches the browser

Pxscene

screen shot 2017-04-12 at 10 17 33 am

Browser

screen shot 2017-04-12 at 10 17 35 am

Pixi Examples - Small basics text differences

basics/text.js is improved over the base code, but it still doesn't match "perfectly"

-- see red and purple arrows in the side-by-side comparison:
The red arrow is an example of the font not matching, the purple is an arrow of the gradient not matching.

(The leftmost window is the old code, the middle is the browser, the rightmost is after recent updates code.)
No technical limitation was given for the differences.

pxscene- dev 2017-04-09 21-04-22

Windows build - artifacts

Build artifacts - none should be present in Git, specifically:

a. libjpeg-turbo and jconfigint.h

b. pthread - don't commit binaries. Commit unmodified source or use downloaded tarfile.

Pixi.js graphics - Text bug

From the last challenge review:

This is a bug:

rtError pxText::setBold(bool var) {
  isBold = var;
  if (getFontResource()->isFontLoaded()) {
    createNewPromise();
    getFontResource()->setBold(isItalic);
  }
  return RT_OK;
}

-- You call setBold but you pass isItalic. You should pass isBold.

Windows build - Crash after testing a few apps

After testing a few different pxscene apps, it's relatively easy to get the Windows build to crash. We need to identify any hangs and fix them in the code.

Log Name:      Application
Source:        Application Hang
Date:          4/1/17 5:35:51 PM
Event ID:      1002
Task Category: (101)
Level:         Error
Keywords:      Classic
User:          N/A
Computer:      JUSTINGASPE68ED
Description:
The program pxScene2d.exe version 0.0.0.0 stopped interacting with Windows and was closed. To see if more information about the problem is available, check the problem history in the Security and Maintenance control panel.
 Process ID: 588
 Start Time: 01d2aab041da3197
 Termination Time: 9
 Application Path: C:\Program Files (x86)\pxCore\pxScene2d.exe
 Report Id: 6b6ae533-16a5-11e7-9f13-001c4241752a
 Faulting package full name: 
 Faulting package-relative application ID: 

Event Xml:
<Event xmlns="http://schemas.microsoft.com/win/2004/08/events/event">
  <System>
    <Provider Name="Application Hang" />
    <EventID Qualifiers="0">1002</EventID>
    <Level>2</Level>
    <Task>101</Task>
    <Keywords>0x80000000000000</Keywords>
    <TimeCreated SystemTime="2017-04-01T06:35:51.855988900Z" />
    <EventRecordID>610</EventRecordID>
    <Channel>Application</Channel>
    <Computer>JUSTINGASPE68ED</Computer>
    <Security />
  </System>
  <EventData>
    <Data>pxScene2d.exe</Data>
    <Data>0.0.0.0</Data>
    <Data>588</Data>
    <Data>01d2aab041da3197</Data>
    <Data>9</Data>
    <Data>C:\Program Files (x86)\pxCore\pxScene2d.exe</Data>
    <Data>6b6ae533-16a5-11e7-9f13-001c4241752a</Data>
    <Data>
    </Data>
    <Data>
    </Data>
    <Binary>55006E006B006E006F0077006E0000000000</Binary>
  </EventData>
</Event>

screen shot 2017-04-01 at 5 38 02 pm

Windows build - Glut

From the client:

Glut usage - focus on win32 for now as primary target

Please make the necessary changes to address this and cover this with documentation in your README

Windows build - Continuous Integration

In an effort to make the Windows build a painless one-click solution, we need to integrate the build into a continuous integration environment.

This one has been mentioned by the client as a potential target, since it's free for Github open source projects: https://www.appveyor.com/

But others are also welcome, assuming they are free and easy to use. Please just make sure to get approval in the forum for anything that's not appveyor.

Review notes:

We need the following completed and reviewed for this ticket:

  1. Step-by-step documentation for setting up the project to build via CI
  2. Instructions for:
  • Building the app
  • Building the installer
  • Building an update package for the auto-updater (#37)
  1. Validation instructions for reviewers

Pixi.js graphics - Code refactor

From the last challenge review:

Should refactor this duplicate code:

    if (mTextureType == PX_TEXTURE_ALPHA_88)
    {
      glBindTexture(GL_TEXTURE_2D, mTextureId);  TRACK_TEX_CALLS();
      glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, PX_TEXTURE_MIN_FILTER);
      glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, PX_TEXTURE_MAG_FILTER);
      glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_S, GL_CLAMP_TO_EDGE);
      glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_T, GL_CLAMP_TO_EDGE);
      glPixelStorei(GL_UNPACK_ALIGNMENT, 1);
      glTexImage2D(
        GL_TEXTURE_2D,
        0,
        GL_ALPHA,
        iw,
        ih,
        0,
        GL_ALPHA,
        GL_UNSIGNED_SHORT,
        mBuffer
      );
      context.adjustCurrentTextureMemorySize(iw*ih*2);
    }
    else
    {
      glBindTexture(GL_TEXTURE_2D, mTextureId);  TRACK_TEX_CALLS();
      glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, PX_TEXTURE_MIN_FILTER);
      glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, PX_TEXTURE_MAG_FILTER);
      glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_S, GL_CLAMP_TO_EDGE);
      glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_T, GL_CLAMP_TO_EDGE);
      glPixelStorei(GL_UNPACK_ALIGNMENT, 1);
      glTexImage2D(
        GL_TEXTURE_2D,
        0,
        GL_ALPHA,
        iw,
        ih,
        0,
        GL_ALPHA,
        GL_UNSIGNED_BYTE,
        mBuffer
      );
      context.adjustCurrentTextureMemorySize(iw*ih);
    }

-- The only differences between the if and else blocks are 2 lines:

        GL_UNSIGNED_SHORT, ->
        GL_UNSIGNED_BYTE,
      context.adjustCurrentTextureMemorySize(iw*ih*2); ->
      context.adjustCurrentTextureMemorySize(iw*ih);

Windows Installer - Installer location

One of the customer requests we have is to have the installer prompt for an installation folder, instead of just going with the default. In the future, the customer may want to have multiple versions of pxscene installed and running for testing, and allowing them to change the default installation folder will help with that.

Windows Build - Code style updates

From the last challenge:

Should add comment below why magic number 8 is being used:

    if(!urlParts.protocol){
        fullPath = urlParts.pathname;
    } else if(urlParts.protocol ==="files:"){
        fullPath = fullPath.substring(8);
    }	

In make_package.iss, should use space consistently:

  {Visual C++ 2010 SP1 Redist(x86) 10.0.40219} 
  { Visual C++ 2015 SP3 Redist(x86) 14.0.24215 }

Why did you reformat the indentation in rtWrapperUtils.h without making any other change?

Linux build failing

Attached is the Travis-CI log - check the travis.yml file to see what it does for Linux.

This was run against the _windows_port branch.

log.txt

Windows build - uSleep functionality

From the client:

  • rtFileDownloader.cpp - please remove "usleep" functionality. Use pxTimer/pxSleep, instead.
  • rtNodeThread.h - please remove "sleep" functionality. Use pxSleep, instead.

Implement "coverflow_v2.js" example

In the gallery folder is a coverflow_v2.js file. This example works well in regular pxScene, but not in the duktape modified version very well.

We need to:

  1. Increase the performance in loading. Right now the app goes to "Not Responding" for a few seconds while things are loaded
  2. Show the rating stars underneath the item name. Right now these are shown in regular pxscene, but not the modified version.

Pixi.js graphics - Font file

From the last challenge review:

I see this in pxscene.log when running the examples:

rt: INFO pxFont.cpp:908 -- Thread-1141184: cannot found font = fonts/FreeSans.ttf.ttf

-- Why is it trying to load "FreeSans.ttf.ttf" when the file is "FreeSans.ttf"?

HTTP / HTTPS support

In the interest of time, we removed HTTP / HTTPS support from the initial duktape integration. We need to add that support back in for the examples, preferably using libcurl, although I'm open to other suggestions. pxScene runs on many different devices, including some embedded devices, so libcurl is a standard choice as it is available just about everywhere.

In addition, examples should be loaded via the initial browser.js by entering a URL, similar to how the regular build of pxscene works.

Pixi.js graphics - Code formatting

These items were from the last code challenge review:

Should fix indentation:

  "{"
    "  vec4 col;"
    "  float lp = v_uv.y;"
    "  col = u_dirColor * (1.0-lp) + a_color*lp;"
    "  float a = u_alpha *  texture2D(s_texture, v_uv).a;"
  "  gl_FragColor = col*a;"
  "}";
...
  "{"
    "vec4 col = vec4(0);"
    "vec2 unit = 1.0 / u_resolution.xy;"
...
    "{"
      "for(float y = -r; y [less-than]= r; y += 1.0)"
      "{"
          "float weight = (r- abs(x)) * (r- abs(y));"
...
    "for(float x = -r; x [less-than]= r; x += 1.0)"
    "{"
      "for(float y = -r; y [less-than]= r; y += 1.0)"
...
  "{"
    "  float a = u_alpha *  blur(v_uv).a;"
    "  gl_FragColor = vec4(a_color.rgb, a);"
...
#include "pxText.h"
  #include FT_BITMAP_H
...
      // set the requested font size
  mUrl = n;
...
      if(mShadow) {
          //render shadow first

Should remove extra inconsistent spaces:

    "  float a = u_alpha *  texture2D(s_texture, v_uv).a;"
  "      vec4 color =  col * fontAlpha + u_effectColor * (1.0 - fontAlpha);"
  "      return vec4( color.rgb,color.a*u_alpha);"
    "  float a = u_alpha *  blur(v_uv).a;"
  if( useTextureDimsAlways)
  if (mShadow && outW > 0 && outH > 0 ) {
    if(mOutlineSize > 0 ) {
sizeof(unsigned char )
          blendImage[2 * index] = data[2*index2];
          blendImage[2 * index+1] = data[2*index2+1];
    context.drawRect(mWidth, mHeight, 0, mFillColor, NULL ,0 );	

Should be consistent with spacing:

        px = (int) (px + mOutlineSize * outlineScale) - 1; //(subW * 0.5)
        py = (int) (py + mOutlineSize * outlineScale);//(subH * 0.5)
  unsigned char * getGlyphBitmapWithOutline(unsigned short theChar, FT_BBox &bbox);
  const GlyphCacheEntry* getGlyph(uint32_t codePoint);  
  rtError init(const FT_Byte*  fontData, FT_Long size, const char* n , FT_Long outlineSize = 0);	

Should remove commented out lines:

  // "      return vec4( color.rgb,max(fontAlpha,outlineAlpha)*color.a*u_alpha);"
  // "      return vec4( color.rgb,max(fontAlpha,outlineAlpha)*u_alpha);"
    // "  gl_FragColor = vec4(a_color.rgb, a_color.a*a);"
  // "      return vec4( a_color.rgb, a_color.a*a);"
    // "  gl_FragColor = vec4(a_color.rgb, a_color.a*a);"
    // FT_Set_Pixel_Sizes(mFace, 0, s);
    // return RT_FAIL;
        // uint32_t offsetX = 0, offsetY = 0;
        // FT_BBox obox;
        // FT_Outline_Get_CBox(&(mFace->glyph->outline) , &obox);
        // FT_BBox nBox;
        // FT_Outline_Get_CBox(&(mFace->glyph->outline) , &nBox);
        // uint32_t xBold = (nBox.xMax - nBox.xMin) - (obox.xMax - obox.xMin);
        // uint32_t yBold = (nBox.yMax - nBox.yMin) - (obox.yMax - obox.yMin);
        // offsetX = xBold >> 1;
        // offsetY = yBold >> 1;
                    // bbox.xMax += offsetX;
                    // bbox.xMin += offsetX;
                    // bbox.yMax += offsetY;
                    // bbox.yMin += offsetY;
    // entry->bitmap_left += mShadowBlurRadio;
        // entry->bitmap_left = blendImageMinX;
//  if(mItalic){
//    w += w*ITALIC_ADD_RATE;
//  }	

Should follow existing code style where opening brace is on separate line:


  "  if ((fontAlpha + outlineAlpha) > 0.0){"
  "  else {"
  "  if ((fontAlpha + outlineAlpha) > 0.0){"
  if(gradientColor == nullptr || gradientColor[3] [less-than]= 0.01){
  if (strokeColor && strokeColor[3] > 0) {
    if (gTextOutlineShader->draw(gResW, gResH, gMatrix.data(), gAlpha, 4, verts, uv,
                                texture, colorPM, gradientColorPM, strokeColorPM) != PX_OK) {
    if (gATextureShader->draw(gResW, gResH, gMatrix.data(), gAlpha, 4, verts, uv, texture, colorPM, gradientColorPM) !=
        PX_OK) {
  if (texture->getType() == PX_TEXTURE_ALPHA_88) {
    if (gTextureBlurForOutlineShader->draw(gResW, gResH, gMatrix.data(), gAlpha, 4, verts, uv, texture, blur, shadowColorPM) != PX_OK) {
    if (gTextureBlurShader->draw(gResW, gResH, gMatrix.data(), gAlpha, 4, verts, uv, texture, blur, shadowColorPM) !=
        PX_OK) {
  if (gAlpha == 0.0 || w [less-than]= 0.0 || h [less-than]= 0.0) {
  if (t.getPtr() == NULL) {
    }else{
  if (mShadow && outW > 0 && outH > 0 ) {
    if(mOutlineSize > 0 ) {
unsigned char * pxFont::getGlyphBitmapWithOutline(unsigned short theChar, FT_BBox &bbox)
const GlyphCacheEntry *pxFont::getGlyph(uint32_t codePoint) {
        if (outlineBitmap == nullptr) {
        for (int x = 0; x [less-than] outlineWidth; ++x) {
          for (int y = 0; y [less-than] outlineHeight; ++y) {
        if (px + outWidth > blendWidth) {
        if (py + outHeight > blendHeight) {
        for (unsigned int x = 0; x [less-than] outWidth; ++x) {
          for (unsigned int y = 0; y [less-than] outHeight; ++y) {
        if (mBold) {
        if (newBmp != ret) {
void pxFont::measureTextInternal(const char *text, uint32_t size, float sx, float sy,
                                float &w, float &h) {
  if (!mInitialized) {
  while ((codePoint = u8_nextchar((char *) text, &i)) != 0) {
    if (codePoint != '\n') {
void pxFont::renderText(const char *text, uint32_t size, float x, float y, float sx, float sy, float *color, float mw,
                        float *gradientColor, float *strokeColor, float * dropShadowColor, float strokeWidth, bool italic, bool bold,
                        bool dropShadow, float dropShadowOffsetX, float dropShadowOffsetY, float dropShadowBlur) {
  if (!text || !mInitialized) {
  if (dropShadow == false || dropShadowColor == NULL || dropShadowColor[3] [less-than]= 0.01) {
  } else {
  while ((codePoint = u8_nextchar((char *) text, &i)) != 0) {
void pxFont::renderText(const char *text, uint32_t size, float x, float y, float sx, float sy, float *color, float mw,
                        float *gradientColor, float *strokeColor, float * dropShadowColor, float strokeWidth, bool italic, bool bold,
                        bool dropShadow, float dropShadowOffsetX, float dropShadowOffsetY, float dropShadowBlur) {
    if (codePoint != '\n') {
      if (x == 0) {
      if(mShadow) {
    } else {
    if (it != mFontMap.end()) {  // local key search in map
    } else {
      if (fp != nullptr) {
      } else {
  if (getFontResource()->isFontLoaded()) {
rtError pxText::setItalic(bool var) {
rtError pxText::setBold(bool var) {
void pxText::updateShadowParams() {
rtError pxText::setDropShadow(bool b) {
rtError pxText::setDropShadowOffsetX(float x) {
rtError pxText::setDropShadowOffsetY(float y) {
rtError pxText::setDropShadowBlur(float b) {
rtError pxText::setStrokeWidth(float w) {	

Should follow existing code style and use 2-space indentation:

  "  else {"
  "      return vec4(0.0,0.0,0.0,0.0);"
  "  }"	

Should follow existing code style and put space after for or if:

    "for(float x = -r; x [less-than]= r; x += 1.0)"
      "for(float y = -r; y [less-than]= r; y += 1.0)"
    "for(float x = -r; x [less-than]= r; x += 1.0)"
      "for(float y = -r; y [less-than]= r; y += 1.0)"
  if( useTextureDimsAlways)
  if(gradientColor == nullptr || gradientColor[3] [less-than]= 0.01){
    if(mStroker)	

Should add comment what 10 represents:

    glUniform1f(mBlurRadiusLoc, 10);	

You have methods named "dealBold", "dealItalic", and "dealShadow". I think you mean "apply" instead of "deal". In English "deal" doesn't make sense in this context.

Wrong comment:

class textureBlurShaderProgram: public shaderProgram
...
}; //CLASS - textureShaderProgram	

What is the purpose of these empty if blocks:

    if (gTextOutlineShader->draw(gResW, gResH, gMatrix.data(), gAlpha, 4, verts, uv,
                                texture, colorPM, gradientColorPM, strokeColorPM) != PX_OK) {
    }
    if (gATextureShader->draw(gResW, gResH, gMatrix.data(), gAlpha, 4, verts, uv, texture, colorPM, gradientColorPM) !=
        PX_OK) {
    }	

Typo in log:

        rtLogInfo("cannot found font = %s", newLocalTTF.c_str());	

Should be consistent about space between arguments/parameters:

  context.drawRect(mw, mh, 1, mEntered?green:red, white,0);
  memcpy(mDropShadowColor,c, sizeof(mDropShadowColor));
    getFontResource()->renderText(tempStr, size, xPos, tempY, sx, sy, color, lineWidth, mGradientColor, mStrokeColor,
                                  mDropShadowColor,mStrokeWidth, isItalic, isBold,
                                  isDropShadow, mDropShadowOffsetX, mDropShadowOffsetY, mDropShadowBlur);
          getFontResource()->renderText(tempStr, pixelSize, xPos, tempY, 1.0, 1.0, color, lineWidth, mGradientColor,
                                        mStrokeColor,mDropShadowColor,mStrokeWidth, isItalic, isBold,
                                        isDropShadow, mDropShadowOffsetX, mDropShadowOffsetY, mDropShadowBlur);
            getFontResource()->renderText(ELLIPSIS_STR, pixelSize, xPos + charW, tempY, 1.0, 1.0, color, lineWidth,
                                          mGradientColor, mStrokeColor,mDropShadowColor,mStrokeWidth, isItalic, isBold,
                                          isDropShadow, mDropShadowOffsetX, mDropShadowOffsetY, mDropShadowBlur);
            getFontResource()->renderText(tempStr, pixelSize, xPos, tempY, 1.0, 1.0, color, lineWidth, mGradientColor,
                                          mStrokeColor,mDropShadowColor,mStrokeWidth, isItalic, isBold,
                                          isDropShadow, mDropShadowOffsetX, mDropShadowOffsetY, mDropShadowBlur);
            getFontResource()->renderText(ELLIPSIS_STR, pixelSize, xPos + charW, tempY, 1.0, 1.0, color, lineWidth,
                                          mGradientColor, mStrokeColor,mDropShadowColor, mStrokeWidth, isItalic, isBold,
                                          isDropShadow, mDropShadowOffsetX, mDropShadowOffsetY, mDropShadowBlur);
  rtProperty(gradientColor,gradientColor, setGradientColor, uint32_t);
  rtProperty(strokeWidth, strokeWidth,setStrokeWidth, float);
  rtProperty(strokeColor, strokeColor,setStrokeColor, uint32_t);
  rtProperty(dropShadowColor, dropShadowColor,setDropShadowColor, uint32_t);
  rtProperty(dropShadowOffsetX, dropShadowOffsetX, setDropShadowOffsetX,float);
  rtProperty(dropShadowBlur, dropShadowBlur,setDropShadowBlur,float);	

[ON HOLD] Answers.js example

From the challenge review:

From forum, answers.js example should be supported.-- see: https://apps.topcoder.com/forums/?module=Thread&threadID=907767&start=0&mc=5

But when I run it there's a black screen and the console shows an exception:

===[LOG LOG] MESSAGE:5 [XModule]: Create new XModule for px-reference//gallery//answers.js[LOG LOG] MESSAGE:4 [AppSceneContext]: createModule_pxScope.call()[LOG LOG] MESSAGE:4 [AppSceneContext]: createModule_pxScope.call() doneUncaught Exception:SyntaxError: parse error (line 1208)    at [anon] (eval:1208) internal    at [anon] (duk_js_compiler.c:443) internal    at [anon] () native strict preventsyield    at 
runInNewContext (C:\pxCore_no-node\temp\_CPack_Packages\win32\NSIS\pxscene-setup/vm.js:4)    
at [anon] (C:\pxCore_no-node\temp\_CPack_Packages\win32\NSIS\pxscene-setup/rcvrcore/AppSceneContext.js:368)    at [anon] (C:\pxCore_no-node\temp\_CPack_Packages\win32\NSIS\pxscene-setup/rcvrcore/AppSceneContext.js:272) preventsyield    
at apply () native strict preventsyield    at tryCatcher (C:\pxCore_no-node\temp\_CPack_Packages\win32\NSIS\pxscene-setup/bluebird.js:5253) strict preventsyield    at call () native strict preventsyield    
at [anon] (C:\pxCore_no-node\temp\_CPack_Packages\win32\NSIS\pxscene-setup/bluebird.js:3275) strict    
at [anon] (C:\pxCore_no-node\temp\_CPack_Packages\win32\NSIS\pxscene-setup/bluebird.js:3332) strict    
at [anon] (C:\pxCore_no-node\temp\_CPack_Packages\win32\NSIS\pxscene-setup/bluebird.js:3377) strict    [...][LOG LOG] MESSAGE:4 [AppSceneContext]: vm.runInNewContext done[LOG LOG] Main Module: readyPromise=nullrt: INFO C:\pxCore_no-node\examples\pxScene2d\src\pxScene2d.cpp:3085 -- Thread-: pxScriptView::makeReady[LOG INFO] AppSceneContext#loadScenePackage1 done===
--

Windows Build - Auto updater

The Mac build of pxscene can auto-update itself.

echo "Info: Checking for Software Update"

VERSION=`cat ./version`
UPDATE_URL=http://www.pxscene.org/dist/osx/pxscene/software_update.plist

./EngineRunner run -productid org.pxscene.pxscene -version $VERSION -url ${UPDATE_URL} &

The software_update.plist contains information about the current version and link to download the update, used by the update-engine (https://code.google.com/archive/p/update-engine/)

We need something similar. It appears that this is an option: https://fman.io/blog/google-omaha-tutorial/

But other suggestions will be welcome, assuming that the library used is BSD or MIT licensed.

REVIEW:

You must provide detailed instructions on:

  1. How the auto-updater works
  2. How to validate updates by reviewers
  3. How to properly package an update (preferably with a new build target to make things easy)
  4. How to sign updates so that Windows doesn't throw errors

Windows build - Freetype

A question from the client:

Freetype - why did you need to modify the externals at all, specifically freetype?

Let's make sure to document what changes are needed to Freetype, and ideally we should be able to use the unmodified externals version.

Windows build - Dependencies

From the client:

Visual Studio project for dependencies did not work out of the box as described in instructions.
Please fix.

Clean up changes outside rtNode

Lots of little changes have been made throughout the rest of the pxScene codebase.

The client wants to limit these changes as much as possible, so we need to:

  1. Add support for missing features so we can rollback changes to pxScene / pxCore
  2. Document why a change is needed

The client has looked at the changes so far and would like to try to limit the changes to rtNode as much as possible.

Windows installer - dependency libraries

The current Windows build depends on these redistributables, but they aren't currently packaged in the installer. We need to update the installer to include these so that the installer can install pxScene and it will run on a bare Windows installation, without any development tools installed.

The 32bit versions of these libraries are required:

https://www.microsoft.com/en-us/download/details.aspx?id=53840

https://www.microsoft.com/en-us/download/details.aspx?id=26999

Windows build - Path handling

  1. The pxscene windows build support local paths , but the path currently needs to be on the same drive letter as the pxscene executable. For example, if your pxscene is installed at C:\Program Files (x86)\pxCore, your local test files must in c partition. We need to update to ensure that any file can be loaded from the local computer.

  2. Because pxscene parses a local path C:\examples\fancy.js as C:/examples/fancy.js, the vscode debugger cannot connect with pxscene. We need to ensure that the debugger can connect properly when debugging local files.

Check the installer works on Windows 7 and 8.

The windows port requires the Windows 10 SDK. But Win7 and Win8 are still not EOL'ed by Microsoft so we must make sure the code can be built and installed on those older versions of Windows.

Pixi.js examples - Node.js code quality

Reviewer Note - If any of these aren't fixed or if more than a couple new issues are added, please score a 1 in question 1.1.4. This code is going directly to the customer, and code quality is a noticeable issue for them. If our code is bad, it just gets kicked back, the client is unhappy, and we end up having to fix it anyways, so we need to focus on stuff like this.

Should add comment what false and true mean below:

  this.renderPolygon(newPoints, false);
  this.renderPolygon(points.slice(0, points.length - 2), true);	

Should be consistent:

                    const holes = data.holes;
...
                    for (let i = 0; i [less-than] holes.length; i++)
                    {
                        const hole = holes[i];
...
                    for (let j = 0; j [less-than] data.holes.length; j++)
                    {
                        this.renderPolygon(data.holes[j].points, true);

-- In the first for loop, you reference holes instead of data.holes.
But in the second loop shown (which is in the same block in PXSceneGraphicsRenderer.js, so holes is still in scope), you use data.holes directly.

No need for the parentheses:

                        newPoints.push(points[(index * 2)]);	

Should simplify:

                shape.width = radius * 2;
                shape.height = radius * 2;
->
                shape.width = shape.height = radius * 2;	

For:

                shape.width = radius * 2;
                shape.height = radius * 2;
                shape.circle = true;
                this.renderRect(data.shape);

-- for consistency, the last line should be:

                this.renderRect(shape);

-- given that:

            const shape = data.shape;

-- Existing code uses:

                this.renderRect(shape);	

Should not change the indentation:

        if (!graphics || !graphics.renderedObject)
      {
            return;
        }	

Should remove this since it's not used anymore after your changes:

        this.circleResource = null;	

Should simplify this to reduce unnecessary nesting:

                if (texture.baseTexture.hasLoaded)
                {
                    if (texture.trim)
                    {
                        renderedObjectSpriteArgs.w = texture.trim.width;
                        renderedObjectSpriteArgs.h = texture.trim.height;
                    }
                }

->

                if (texture.baseTexture.hasLoaded && texture.trim)
                {
                    renderedObjectSpriteArgs.w = texture.trim.width;
                    renderedObjectSpriteArgs.h = texture.trim.height;
                }	

Should fix the indentation:

            if (!this._texture.baseTexture.hasLoaded)
{
        if (this.renderParent)
{

        if (this.renderParent)
{	

Should remove the empty comment:

            if (Array.isArray(style.fill))
            {
                gradientColor = style.fill[1];
            }
            //	

Comments not necessary, redundant with code:

        const tileScaleX = ts.tileScale.x; // tile scale x
        const tileScaleY = ts.tileScale.y; // tile scale y	

Should be consistent about putting a space before // appended to a statement:

        const tw = texture.trim.width * tileScaleX; // ts tile width
        const th = texture.trim.height * tileScaleY;// ts tile height	

Typos in comments:

is it a outline
tile clounm number	

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.