Code::Blocks with C/C++ Compiler


I was particularly interested in GL_OES_draw_texture, ...

I have never succeed in using GL_OES_draw_texture. It never draw anything for me. That's a shame, because it sound simple to use, but I always get nothing...

I tried using GL_OES_draw_texture and it works. You need to use correct coordinate system - the screen coordinate 0,0 is in the bottom left corner.

Here is a working simplified example (using EGLPort library):
Code:
#include <GLES/gl.h>
#include <GLES/glext.h>
#include <EGL/egl.h>
#include "eglport.h"
#include <SDL/SDL.h>
#include <stdint.h>
#include <memory.h>

uint8_t *texdata;
GLuint texture[1];
PFNGLDRAWTEXIOESPROC glDrawTexiOES;

static void prepareTexture(void) {
  int i, j;
  texdata = (uint8_t *) malloc(256*256*3);
  for (i = 0; i <= 255; i++) {
    for (j = 0; j <= 255; j++) {
      texdata[3 * 256 * i + 3 * j + 0] = (i + j) / 2;
      texdata[3 * 256 * i + 3 * j + 1] = (i + j) / 2;
      texdata[3 * 256 * i + 3 * j + 2] = (i + j) / 2;
    }
  }

  glGenTextures(1, &texture[0]);
  glBindTexture(GL_TEXTURE_2D, texture[0]);

  glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_LINEAR);
  glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_LINEAR);

  glTexImage2D(GL_TEXTURE_2D, 0, GL_RGB, 256, 256, 0, GL_RGB, GL_UNSIGNED_BYTE, texdata);
}

static void DrawGLScene(void) {
  glClear(GL_COLOR_BUFFER_BIT);

  glBindTexture(GL_TEXTURE_2D, texture[0]);

  GLint coords [] = {50, 50, 200, 164};
  glTexParameteriv( GL_TEXTURE_2D, GL_TEXTURE_CROP_RECT_OES, coords );
  glDrawTexiOES( 200, 280, 0, 300, 200 );

  EGL_SwapBuffers();
}

int main(int argc, char **argv) {
  int done;
  SDL_Event event;

  SDL_Init(SDL_INIT_VIDEO);
  SDL_SetVideoMode(800, 480, 0, SDL_FULLSCREEN);
  EGL_Open(800, 480);

  glEnable(GL_TEXTURE_2D);
  // should check first if "GL_OES_draw_texture" extension is available
  glDrawTexiOES = (PFNGLDRAWTEXIOESPROC) eglGetProcAddress("glDrawTexiOES");
  prepareTexture();

  done = 0;
  while ( ! done ) {
    DrawGLScene();

    while ( SDL_PollEvent(&event) ) {
      if ( event.type == SDL_QUIT ) done = 1;
      if ( event.type == SDL_KEYDOWN ) {
        if ( event.key.keysym.sym == SDLK_ESCAPE ) done = 1;
      }
    }
  }
  EGL_Close();
  SDL_Quit();
  return 0;
}
 
Oh, thanks for the sample @M-HT . I was missing the GL_TEXTURE_CROP_RECT_OES setup, maybe that's why I had nothing.
I'll try to implement proper use of that function in glshim...
 
Just a notice for the next release of Codeblocks or someone that need fmod library for arm.
I just found the lib compiled for arm (both HardFloat than softfloat) in the archive of this (little) demo (define this a demo is a big word).
link to PewSquareScroller
A quick recompile and run..and all seems run fine.
 
Nice find @Farox! I'll look at adding that.
[doublepost=1463944483,1463924661][/doublepost]I have checked the version. It's version 1.6. That's better than nothing, but unfortunatly, most resent software wants a 4.x version (I tryied with gzdoom for example). Still, next codeblocks will have it :)
 
Once CB has been started, I can't run Palemoon:
Code:
symbol lookup error: /mnt/utmp/palemoon/lib/libX11.so.6: undefined symbol: xcb_wait_for_reply64
or lightweight2:
Code:
symbol lookup error: /mnt/utmp/codeblocks/usr/lib/libXi.so: undefined symbol: _XGetRequest

After closing CB there still is a codeblocks folder in /mnt/utmp. Can't be unmounted, "is mounted multiple times". After rebooting I can start the browsers mentioned above. I am on the latest version and have deleted old appdata folders before upgrading.

Just know that I don't understand any of this.
 
Nice News from here.
I found a Site with Games where are easy to Port for the Pandora :D

Portet 3-4 Games @Home.
Packaging will come next Days.
Its Freeblocks,Lumper,An alpha Version 3D Pod Racer and an old RPG Game from the Basic Times.
Freeblocks is realy nice and work out of the Box with the Pandora Controlls.

Have found a secret Site with simple Opensource Games for porting. :D

Edit: oh most of the Games where already in the Repo :D
 
Last edited:
Hi i have a Question.

I use often your magic copy_libs.sh and that work very fine.
It copy all Libs into the right Folder.

And that is a little my Problem...all Libs for this Game..even when most of them are integrated in the Zaxxon itself?
The last little portet Games from me have mostly around 30MB because too many Libs?

Is there a Way to copy only the Libs who are only realy needed and not the Libs who are in the Zaxxon already?

Or must i sort them out manualy?

Maybe you have a Script for it?

Maybe i can decrase the Filesize of my PNDs then drasticly?

Is just an Idea..the Solution with the copy_libs_pnd work fine..
..but decrasing the Filesize of the PNDs would be nice too. :)

I hope i explained it right with my bad English :oops:
 
The copy_libs.sh script already do that. It only copy libs that are not in /lib or /usr/lib

What can be confusing is that codeblocks has some version of the libs that are newer than on the firmware, so they are copied by the script even if the version in the firmware might work.
 
@ptitSeb

Hi and sorry for my DoublePost.
I portet some Games and want to package them as PND.
Unfortunaly this Game use for sliding the ctrl Key.

Ist there any simple Solution like a Script Command to assign the ctrl Key to one of the Pandora Gaming Buttons?
 
If it's a SDL game, do some
Code:
grep SDLK_" src/* -rn
to have all the place where Key constant are used and change to one of the Pandora button ({X} is SDLK_PAGEDOWN {B} is SDLK_END for example).
 
If I remember correctly, allegro5_dialog as some dependancies that are difficult to meet (but I don't remeber wich one, gtk-gl perhaps?).
 
1)
I am trying to build guile. While running ./configure I get an error for libcrypto.so.1.0.0 not found. But this file is in /mnt/utmp/codeblocks/usr/lib and that directory is in the LD_LIBRARY_PATH
How come the lib is not found?

2)
When I have the other problem fixed, can I set
./configure --prefix=/mnt/utmp/codeblocks/usr/share
to basically make install stuff to the SD card that I need to build other things?
 
Last edited:
@kuru :

1/ look at "config.log" to check the precise error message, may be it's a dependancie that you will need to add to LIBS that is missing.

2/ yes, but simply use
Code:
./configure --prefix=/mnt/utmp/codeblocks/usr
to write directly "in" the pnd
or
Code:
./configure --prefix=/mnt/utmp/codeblocks/local
to stay outside the pnd folders.
 
1)
I had a look at the config.log earlier, it also complains about not finding a lib that does exist in /mnt/utmp/codeblocks/usr/lib: libisl.so.13
Code:
/mnt/utmp/codeblocks/usr/libexec/gcc/armv7l-unknown-linux-gnueabi/5.2.0/cc1:
error while loading shared libraries: libisl.so.13: cannot open shared object
file: No such file or directory
configure:3199: $? = 1
configure:3237: result:
configure: failed program was:
| /* confdefs.h.  */
| #define PACKAGE_NAME "guile"
| #define PACKAGE_TARNAME "guile"
| #define PACKAGE_VERSION "1.8.2"
| #define PACKAGE_STRING "guile 1.8.2"
| #define PACKAGE_BUGREPORT "bug-guile@gnu.org"
| /* end confdefs.h.  */
|
| int
| main ()
| {
|
|   ;
|   return 0;
| }
configure:3243: error: C compiler cannot create executables
See `config.log' for more details.

## ---------------- ##
## Cache variables. ##
## ---------------- ##


## ----------------- ##
## Output variables. ##
## ----------------- ##


## ----------- ##
## confdefs.h. ##
## ----------- ##

#define PACKAGE_NAME "guile"
#define PACKAGE_TARNAME "guile"
#define PACKAGE_VERSION "1.8.2"
#define PACKAGE_STRING "guile 1.8.2"
#define PACKAGE_BUGREPORT "bug-guile@gnu.org"

configure: exit 77

2)
Awesome, thanks!
 
Last edited:
@kuru, try to modify configure, change the first line from
Code:
#!/bin/sh
to
Code:
#!/bin/bash
That should help.

Also, be sure to have typed in your password when launching the Codeblocks Command Line.
 
Back
Top