Gambuino:: Gamebuino is implicitly deleted because the default definition

ok im having the same problem with my library that I had weeks ago when I first started to create the new library. The library in question is for a game making and playing library called gamebuino.

basically I made my own display files and did some slight modifications to the gamebuino library to accept the new display file and added extra buttons. I first started by mixing my LCD’s main file anf gfx files with the ones supllied by teensy since im using a teensy 3.2. after that I combined them all into a single .h and .cpp display file to add to the gamebuino library.

everything looks good but I keep the errors listed in the title…

Arduino: 1.6.11 (Windows 7), TD: 1.30-beta3, Board: "Gamebuino"

In file included from C:\Users\duhjoker\Documents\Arduino\libraries\GamebuinoAP/Gamebuino.h:28:0,

                 from C:\Users\duhjoker\Desktop\TEST\TEST.ino:2:

C:\Users\duhjoker\Documents\Arduino\libraries\GamebuinoAP/DisplayRGB.h: In member function 'void Display::drawPixel(int16_t, int16_t, uint16_t)':

C:\Users\duhjoker\Documents\Arduino\libraries\GamebuinoAP/DisplayRGB.h:257:6: error: 'buffer' was not declared in this scope

  if (buffer) {

      ^

C:\Users\duhjoker\Desktop\TEST\TEST.ino: At global scope:

TEST:3: error: use of deleted function 'Gamebuino::Gamebuino()'

 Gamebuino gb;

           ^

In file included from C:\Users\duhjoker\Desktop\TEST\TEST.ino:2:0:

C:\Users\duhjoker\Documents\Arduino\libraries\GamebuinoAP/Gamebuino.h:38:7: note: 'Gamebuino::Gamebuino()' is implicitly deleted because the default definition would be ill-formed:

 class Gamebuino {

       ^

C:\Users\duhjoker\Documents\Arduino\libraries\GamebuinoAP/Gamebuino.h:38:7: error: use of deleted function 'Display::Display()'

In file included from C:\Users\duhjoker\Documents\Arduino\libraries\GamebuinoAP/Gamebuino.h:28:0,

                 from C:\Users\duhjoker\Desktop\TEST\TEST.ino:2:

C:\Users\duhjoker\Documents\Arduino\libraries\GamebuinoAP/DisplayRGB.h:48:7: note: 'Display::Display()' is implicitly deleted because the default definition would be ill-formed:

 class Display : public Print

       ^

C:\Users\duhjoker\Documents\Arduino\libraries\GamebuinoAP/DisplayRGB.h:48:7: error: uninitialized const member in 'class Display'

In file included from C:\Users\duhjoker\Documents\Arduino\libraries\GamebuinoAP/Gamebuino.h:28:0,

                 from C:\Users\duhjoker\Desktop\TEST\TEST.ino:2:

C:\Users\duhjoker\Documents\Arduino\libraries\GamebuinoAP/DisplayRGB.h:146:3: note: 'const int16_t Display::WIDTH' should be initialized

   WIDTH, HEIGHT;   // This is the 'raw' display w/h - never changes

   ^

In file included from C:\Users\duhjoker\Documents\Arduino\libraries\GamebuinoAP/Gamebuino.h:28:0,

                 from C:\Users\duhjoker\Desktop\TEST\TEST.ino:2:

C:\Users\duhjoker\Documents\Arduino\libraries\GamebuinoAP/DisplayRGB.h:48:7: error: uninitialized const member in 'class Display'

 class Display : public Print

       ^

In file included from C:\Users\duhjoker\Documents\Arduino\libraries\GamebuinoAP/Gamebuino.h:28:0,

                 from C:\Users\duhjoker\Desktop\TEST\TEST.ino:2:

C:\Users\duhjoker\Documents\Arduino\libraries\GamebuinoAP/DisplayRGB.h:146:10: note: 'const int16_t Display::HEIGHT' should be initialized

   WIDTH, HEIGHT;   // This is the 'raw' display w/h - never changes

          ^

Multiple libraries were found for "Gamebuino.h"
 Used: C:\Users\duhjoker\Documents\Arduino\libraries\GamebuinoAP
 Not used: C:\Users\duhjoker\Documents\Arduino\libraries\LCD_2000_7775_TEENSY2
exit status 1
use of deleted function 'Gamebuino::Gamebuino()'

This report would have more information with
"Show verbose output during compilation"
option enabled in File -> Preferences.

sketch made using the library with new bitmap functions. same way I would normally do it using og gamebuino library

#include <SPI.h>
#include <Gamebuino.h>
Gamebuino gb;

//#define GREEN 0x0400 

const byte green_square[] PROGMEM ={16,16,
 B11111111,B11111111,
 B11111111,B11111111,
 B11111111,B11111111,
 B11111111,B11111111,
 B11111111,B11111111,
 B11111111,B11111111,
 B11111111,B11111111,
 B11111111,B11111111,
 B11111111,B11111111,
 B11111111,B11111111,
 B11111111,B11111111,
 B11111111,B11111111,
 B11111111,B11111111,
 B11111111,B11111111,
 B11111111,B11111111,
 B11111111,B11111111,};



void setup() {
  gb.begin();
  gb.titleScreen(F("test"));

}

void loop() {
 if(gb.update()){
  gb.display.drawBitmap(70, 70, green_square, 16,16, GREEN);
 }

}

I included the full new library

Why doesn't your Lameduino class (OK, Gamebuino) have a constructor? Even if you don't think you need one, because it doesn't do anything, get off your lazy ass and create one.

You can initialize const members in the constructor's member initialization list:

Display::Display() : WIDTH(LCDWIDTH), HEIGHT(LCDHEIGHT) 
        {}

If the compiler follows C++11 rules you can initialize them in the declaration like any other const variable:

   protected:
    const int16_t
        WIDTH=LCDWIDTH, HEIGHT=LCDHEIGHT;   // This is the 'raw' display w/h - never changes

Ok so I was also told it might be easier to just update the gamebuinos display functions with the new color ones. But I'm wondering about the SPI, I did some looking and saw that the LCD uses the same SPI pins. Does that mean that the OG gamebuinos SPI functions will work with my screen?

Are we supposed to know which screen you have?

Sorry about that.

The screen is an inhaos LCD_2000_7775 and can be found here…

http://www.inhaos.com/product_info.php?products_id=77

All right so I’ve been trying to change the functions and definitions from the color GFX source file to the gamebuinos display source file, I also added the bits that let you actually display color. I tried to compile my bit map and it didn’t give the color argument after uncommenting it at the top of the sketch.

Now I’m having trouble with the draw pixel command. I replaced the gamebuinos again with the new color version from the GFX and it’s giving me errors about the buffer the width the height and the rotation lines.

Editing in process

this is the function

inline void drawPixel(int16_t x, int16_t y, uint16_t color);

definition

void Display::drawPixel(int16_t x, int16_t y, uint16_t color) {
 if (Buffer) {
 if ((x < 0) || (y < 0) || (x >= _width) || (y >= _height)) return;

 int16_t t;
 switch (rotation) {
 case 1:
 t = x;
 x = WIDTH - 1 - y;
 y = t;
 break;
 case 2:
 x = WIDTH - 1 - x;
 y = HEIGHT - 1 - y;
 break;
 case 3:
 t = x;
 x = y;
 y = HEIGHT - 1 - t;
 break;
 }

 buffer[x + y * WIDTH] = color;
 }
}

errors

Arduino: 1.6.11 (Windows 7), TD: 1.30-beta3, Board: "Gamebuino"

In file included from C:\Users\duhjoker\Documents\Arduino\libraries\Gamebuinosummoner123/Gamebuino.h:28:0,

                 from C:\Users\duhjoker\Desktop\TEST\TEST.ino:2:

C:\Users\duhjoker\Documents\Arduino\libraries\Gamebuinosummoner123/Display.h: In member function 'void Display::drawPixel(int16_t, int16_t, uint16_t)':

C:\Users\duhjoker\Documents\Arduino\libraries\Gamebuinosummoner123/Display.h:246:6: error: 'Buffer' was not declared in this scope

  if (Buffer) {

      ^

C:\Users\duhjoker\Documents\Arduino\libraries\Gamebuinosummoner123/Display.h:247:35: error: '_width' was not declared in this scope

   if ((x < 0) || (y < 0) || (x >= _width) || (y >= _height)) return;

                                   ^

C:\Users\duhjoker\Documents\Arduino\libraries\Gamebuinosummoner123/Display.h:247:52: error: '_height' was not declared in this scope

   if ((x < 0) || (y < 0) || (x >= _width) || (y >= _height)) return;

                                                    ^

C:\Users\duhjoker\Documents\Arduino\libraries\Gamebuinosummoner123/Display.h:250:11: error: 'rotation' was not declared in this scope

   switch (rotation) {

           ^

C:\Users\duhjoker\Documents\Arduino\libraries\Gamebuinosummoner123/Display.h:253:8: error: 'WIDTH' was not declared in this scope

    x = WIDTH - 1 - y;

        ^

C:\Users\duhjoker\Documents\Arduino\libraries\Gamebuinosummoner123/Display.h:258:8: error: 'HEIGHT' was not declared in this scope

    y = HEIGHT - 1 - y;

        ^

C:\Users\duhjoker\Documents\Arduino\libraries\Gamebuinosummoner123/Display.h:267:3: error: 'buffer' was not declared in this scope

   buffer[x + y * WIDTH] = color;

   ^

C:\Users\duhjoker\Documents\Arduino\libraries\Gamebuinosummoner123/Display.h:267:18: error: 'WIDTH' was not declared in this scope

   buffer[x + y * WIDTH] = color;

                  ^

Multiple libraries were found for "Gamebuino.h"
 Used: C:\Users\duhjoker\Documents\Arduino\libraries\Gamebuinosummoner123
 Not used: C:\Users\duhjoker\Documents\Arduino\libraries\LCD_2000_7775_TEENSY2
exit status 1
Error compiling for board Gamebuino.

This report would have more information with
"Show verbose output during compilation"
option enabled in File -> Preferences.

here is the h file wuth both definition anf function in it

new display file

[code]
#ifndef DISPLAY_H
#define DISPLAY_H

#include <Arduino.h>
#include <avr/pgmspace.h>
#include <SPI.h>

#include "settings.c"

//colors
//#define WHITE 0
//#define BLACK 1
//#define INVERT 2
//#define GRAY 3

//for extended bitmap function :
#define NOROT 0
#define ROTCCW 1
#define ROT180 2
#define ROTCW 3
#define NOFLIP 0
#define FLIPH 1
#define FLIPV 2
#define FLIPVH 3

#if (DISPLAY_ROT == NO_ROT)||(DISPLAY_ROT == ROT180) //landscape mode
#define LCDWIDTH 220
#define LCDHEIGHT 176
#else //portrait mode
#define LCDWIDTH 176
#define LCDHEIGHT 220
#endif
#define LCDHEIGHT_NOROT 176
#define LCDWIDTH_NOROT 220

#define swap(a, b) { int8_t t = a; a = b; b = t; }

#define PCD8544_POWERDOWN 0x04
#define PCD8544_ENTRYMODE 0x02
#define PCD8544_EXTENDEDINSTRUCTION 0x01

#define PCD8544_DISPLAYBLANK 0x0
#define PCD8544_DISPLAYNORMAL 0x4
#define PCD8544_DISPLAYALLON 0x1
#define PCD8544_DISPLAYINVERTED 0x5

// H = 0
#define PCD8544_FUNCTIONSET 0x20
#define PCD8544_DISPLAYCONTROL 0x08
#define PCD8544_SETYADDR 0x40
#define PCD8544_SETXADDR 0x80
#define PCD8544_SETXADDR 0x80

// H = 1
#define PCD8544_SETTEMP 0x04
#define PCD8544_SETBIAS 0x10
#define PCD8544_SETVOP 0x80

extern uint8_t _displayBuffer[];

typedef uint16_t color;

class Display : public Print {
public:
 void begin(int8_t SCLK, int8_t DIN, int8_t DC, int8_t CS, int8_t RST);

 void command(uint8_t c);
 void data(uint8_t c);
 uint8_t* getBuffer();

 void setContrast(uint8_t val);
 void clear(void);
 void update();

 void setColor(int8_t c);
 void setColor(int8_t c, int8_t bg);
 inline void drawPixel(int16_t x, int16_t y, uint16_t color);
 //inline uint8_t getPixel(int8_t x, int8_t y);

 void drawLine(int16_t x0, int16_t y0, int16_t x1, int16_t y1, uint16_t color);
 void drawFastVLine(int16_t x, int16_t y, int16_t h, uint16_t color);
 void drawFastHLine(int16_t x, int16_t y, int16_t w, uint16_t color);
 void drawRect(int16_t x, int16_t y, int16_t w, int16_t h, uint16_t color);
 void fillRect(int16_t x, int16_t y, int16_t w, int16_t h, uint16_t color);
 void fillScreen(uint16_t color);
    void invertDisplay(boolean i);

   void drawCircle(int16_t x0, int16_t y0, int16_t r, uint16_t color);
   void drawCircleHelper(int16_t x0, int16_t y0, int16_t r, uint8_t cornername, uint16_t color);
   void fillCircle(int16_t x0, int16_t y0, int16_t r, uint16_t color);
   void fillCircleHelper(int16_t x0, int16_t y0, int16_t r, uint8_t cornername, int16_t delta, uint16_t color);
 
   void drawTriangle(int16_t x0, int16_t y0, int16_t x1, int16_t y1, int16_t x2, int16_t y2, uint16_t color);
   void fillTriangle(int16_t x0, int16_t y0, int16_t x1, int16_t y1, int16_t x2, int16_t y2, uint16_t color);
   void drawRoundRect(int16_t x0, int16_t y0, int16_t w, int16_t h, int16_t radius, uint16_t color);
   void fillRoundRect(int16_t x0, int16_t y0, int16_t w, int16_t h, int16_t radius, uint16_t color);


   void drawBitmap(int16_t x, int16_t y, const uint8_t *bitmap, int16_t w, int16_t h, uint16_t color);
   void drawBitmap(int16_t x, int16_t y, const uint8_t *bitmap, int16_t w, int16_t h, uint16_t color, uint16_t bg);
   void drawBitmap(int16_t x, int16_t y, uint8_t *bitmap, int16_t w, int16_t h, uint16_t color);
   void drawBitmap(int16_t x, int16_t y, uint8_t *bitmap, int16_t w, int16_t h, uint16_t color, uint16_t bg);
   boolean getBitmapPixel(const uint8_t* bitmap, uint8_t x, uint8_t y);
 
   void drawTilemap(int x, int y, const uint8_t *tilemap, const uint8_t **spritesheet);
   void drawTilemap(int x, int y, const uint8_t *tilemap, const uint8_t **spritesheet,uint8_t dx,uint8_t dy,uint8_t dw,uint8_t dh);
 
 void setFont(const uint8_t* f); uint8_t fontWidth, fontHeight;
 void drawChar(int16_t x, int16_t y, unsigned char c, uint16_t color, uint16_t bg, uint8_t size);
 
 virtual size_t write(uint8_t);
 
 boolean persistence; //disable clean() at each frame if true
 boolean textWrap; // If set, 'wrap' text at right edge of 
 uint8_t fontSize;
 int8_t cursorX, cursorY;
 byte contrast;
 byte frameCount;

 
  typedef struct{       //line 171 "Public Variables   - ADD by Summoner123
  int x;                    //X coordinate                 - ADD by Summoner123
  int y;                    //Y coordinate                 - ADD by Summoner123
  const byte *spritecol;    //Sprite of object             - ADD by Summoner123
  }object;
  object solid[60];         // Matriz were saved a Sprite, X and Y cordinates of all tiles on the screen - ADD by Summoner123

  byte numcolision = 0;     //count of solid objects indacat how many tiles drawed on the screen - ADD by Summoner123
  
 bool flagcollision = true; 
 
 
private:
 int8_t sclk, din, dc, cs, rst;
 volatile uint8_t *mosiport, *clkport, *csport, *dcport;
 uint8_t mosipinmask, clkpinmask, cspinmask, dcpinmask;
 
 uint8_t *font;
 uint8_t color, bgcolor;
};

inline uint8_t* Display::getBuffer(){
 return _displayBuffer;
}

/*inline void Display::drawPixel(int8_t x, int8_t y) {
 if ((x < 0) || (x >= LCDWIDTH) || (y < 0) || (y >= LCDHEIGHT))
 return;
 
 byte c = color;
 if(color == INVERT){
 c = !getPixel(x, y);
 } else if(color == GRAY){
 if(((frameCount & 0x01) ^ ((x & 0x01) ^ (y & 0x01)) == 0)){ //alternative checkers pattern
 c = WHITE;
 } else {
 c= BLACK;
 }
 }
 
 if(c == WHITE){ //white
#if DISPLAY_ROT == NOROT
 _displayBuffer[x + (y / 8) * LCDWIDTH_NOROT] &= ~_BV(y % 8);
#elif DISPLAY_ROT == ROTCCW
 _displayBuffer[LCDHEIGHT - y - 1 + (x / 8) * LCDWIDTH_NOROT] &= ~_BV(x % 8);
#elif DISPLAY_ROT == ROT180
 _displayBuffer[LCDWIDTH - x - 1 + ((LCDHEIGHT - y - 1) / 8) * LCDWIDTH_NOROT] &= ~_BV((LCDHEIGHT - y - 1) % 8);
#elif DISPLAY_ROT == ROTCW
 _displayBuffer[y + ((LCDWIDTH - x - 1) / 8) * LCDWIDTH_NOROT] &= ~_BV((LCDWIDTH - x - 1) % 8);
#endif
 return;
 }
 else { //black
#if DISPLAY_ROT == NOROT
 _displayBuffer[x + (y / 8) * LCDWIDTH_NOROT] |= _BV(y % 8);
#elif DISPLAY_ROT == ROTCCW
 _displayBuffer[LCDHEIGHT - y - 1 + (x / 8) * LCDWIDTH_NOROT] |= _BV(x % 8);
#elif DISPLAY_ROT == ROT180
 _displayBuffer[LCDWIDTH - x - 1 + ((LCDHEIGHT - y - 1) / 8) * LCDWIDTH_NOROT] |= _BV((LCDHEIGHT - y - 1) % 8);
#elif DISPLAY_ROT == ROTCW
 _displayBuffer[y + ((LCDWIDTH - x - 1) / 8) * LCDWIDTH_NOROT] |= _BV((LCDWIDTH - x -1) % 8);
#endif
 return;
 }
}

inline uint8_t Display::getPixel(int8_t x, int8_t y) {
 if ((x < 0) || (x >= LCDWIDTH) || (y < 0) || (y >= LCDHEIGHT))
 return 0;

 return (_displayBuffer[x + (y / 8) * LCDWIDTH] >> (y % 8)) & 0x1;
}*/

void Display::drawPixel(int16_t x, int16_t y, uint16_t color) {
 if (Buffer) {
 if ((x < 0) || (y < 0) || (x >= _width) || (y >= _height)) return;

 int16_t t;
 switch (rotation) {
 case 1:
 t = x;
 x = WIDTH - 1 - y;
 y = t;
 break;
 case 2:
 x = WIDTH - 1 - x;
 y = HEIGHT - 1 - y;
 break;
 case 3:
 t = x;
 x = y;
 y = HEIGHT - 1 - t;
 break;
 }

 buffer[x + y * WIDTH] = color;
 }
}

uint16_t RGB(uint16_t r, uint16_t g, uint16_t b);

#endif /* DISPLAY_H */

[/code]

Display.h:246:6: error: 'Buffer' was not declared in this scope

In which scope IS Buffer defined? None. Nada. Zip. Zilch.

Your reading comprehension skills leave a lot to be desired sometimes.

Almost there I just can't seem to figure out how to add the color arguments to the tilemap functions properly in the cpp and h files. Got kinda late!! I can't believe I'm down to that.

Ok so can someone please explain about the SPI? I'm assuming the code is pretty much interchangeable since both the Gamebuino display and my display use the same pin out with different names for the pins.

If I'm wrong please tell me so I can start figuring that out.