0

I am using Cocos2D-X 2.3 under Marmalade 7.3 and I am trying to draw a line on my screen.

The code that I am using is below.

void draw()
{
    glLineWidth(10);
    ccDrawColor4B(0, 0, 0, 255);
    ccDrawLine(ccp(0, screenSize.height), ccp(screenSize.width, screenSize.height));
}

With this code the line is drawn, but no matter what I do I can change its width. It seems that the glLineWidth function simply doesn't work.

CodeSmile
  • 64,284
  • 20
  • 132
  • 217
Felipe
  • 6,312
  • 11
  • 52
  • 70

1 Answers1

0

I finally got it working. The problem was that I was using the Marmalade simultator to test my application, and apparently I didn't configure an Open GL on it, therefore the glLineWidth function wasn't working because there was no GL to call.

To solve it I started the simulator and went into Configuration -> GL in there I selected a GLES API (GLES 3.0 from Imagination POWERVR(TM)) and everything worked fine.

I also deployed my application to a mobile device (in my case an Android tablet) and everything worked there as well. :)

Felipe
  • 6,312
  • 11
  • 52
  • 70