• Activity
  • Votes
  • Comments
  • New
  • All activity
    1. Help with finding out more about an obsure c++ graphics library

      I recently started classes again a little over a week ago. One of the classes I am taking is Computer science 2. One of the things it includes is openGL based graphics programming. They have us...

      I recently started classes again a little over a week ago. One of the classes I am taking is Computer science 2. One of the things it includes is openGL based graphics programming. They have us using glut, which is not bad in it self. However what they do is provide us a wrapper library for glut. In the form of a header named "graph1.h" and a precompiled library. Which goes by various names, such as "graphLib1.lib", "graphLib2010.lib", "graphLib2022.lib", "graphicLib2015.lib", etc. It's provided in the form of Windows flavored x86, Macos flavored x86_64 and arm. However, no forms for Linux. While I have been using Windows and VS Studio for classes so far, I strongly prefer my current Linux based tool chain. (text editor, build system, debugger). I have tried cross compiling with mingw-w64, but it fails when I try to link it. I would very much like to use it natively. To do this I would need either the library or the sources to compile it myself. That is what I would really like to find.

      Here is more about the library it self. It is based off of BMPLoader, a small library for loading bitmaps as openGL textures. It also inherits its license from BMPLoader too, because it is a derivative of BMPLoader. (GPLv2; and has been distributed). When you unpack the library there are 3 object files, BMPLoader.o, loadPNG.o, and example2.o. (.o/.obj) I have found traces of it online, however they all link back to my University, University of Central Arkansas. I have also found evidence of it being used at GSU too, but it is from one of the professors that is now here at UCA. (They even provided a pdf on using it, I hashed them and they were the same). Here is a copy of the header graph1.h.

      graph1.h
      /*BMPLoader - loads Microsoft .bmp format
          Copyright (C) 2006  Chris Backhouse
      
          This program is free software; you can redistribute it and/or modify
          it under the terms of the GNU General Public License as published by
          the Free Software Foundation; either version 2 of the License, or
          (at your option) any later version.
      
          This program is distributed in the hope that it will be useful,
          but WITHOUT ANY WARRANTY; without even the implied warranty of
          MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
          GNU General Public License for more details.
      
          You should have received a copy of the GNU General Public License along
          with this program; if not, write to the Free Software Foundation, Inc.,
          51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
      
      
        cjbackhouse@hotmail.com 		www.backhouse.tk
        
        I would appreciate it if anyone using this in something cool would tell me
        so I can see where it ends up.
      
        Takes a filename, returns an array of RGB pixel data
        Loads:
        24bit bitmaps
        256 colour bitmaps
        16 colour bitmaps
        2 colour bitmaps  (Thanks to Charles Rabier)
      
        This code is designed for use in openGL programs, so bitmaps not correctly padded will not
        load properly, I believe this only applies to: 
        256cols if width is not a multiple of 4
        16cols if width is not a multiple of 8
        2cols if width is not a multiple of 32
      
        Sample code:
      
      	BMPClass bmp;
      	BMPLoad(fname,bmp);
      	glTexImage2D(GL_TEXTURE_2D,0,3,bmp.width,bmp.height,0,GL_RGB,GL_UNSIGNED_BYTE,bmp.bytes);
      */
      #include <windows.h>
      #include <gl/glut.h>
      #include <iostream>
      #include <cstring>
      #include <string>
      #define endg "_endg_"
      
      
      #ifndef BMPLOADER_H
      #define BMPLOADER_H
      
      #include <iostream>
      #include <cstring>
      
      using namespace std;
      
      typedef unsigned char BYTE;
      
      class BMPClass
      {
      public:
      	BMPClass();
      	~BMPClass();
      	BYTE& pixel(int x,int y,int c);
      	void allocateMem();
      	int width,height;
      	BYTE* bytes;			//OpenGL formatted pixels
      };
      
      #define BMPError char
      #define BMPNOTABITMAP 'b'	//Possible error flags
      #define BMPNOOPEN 'o'
      #define BMPFILEERROR 'f'
      #define BMPBADINT 'i'
      #define BMPNOERROR '\0'
      #define BMPUNKNOWNFORMAT 'u'
      
      //Loads the bmp in fname, and puts the data in bmp
      BMPError BMPLoad(string fname,BMPClass& bmp);
      
      //Translates my error codes into English	
      std::string TranslateBMPError(BMPError err);	
      
      //Load and select in OpenGL
      BMPError BMPLoadGL(string fname);
      
      struct Precision
      {
        int precision;
        bool precisionFlag;
      };
      
      struct GraphColor
      {
        int r;
        int g;
        int b;
      };
      
      class Gout
      {
        private:
          int x;
          int y;
          int r;
          int g;
          int b;
          int precision;
          bool precisionFlag;
      
      
        public:
          Gout() { r= 0; g=255; b= 0; precisionFlag = false; };
          void setX(int x) { this->x = x;}
          void setY(int y) { this->y = y;}
          int getX() { return x;}
          int getY() { return y;}
          void setR(int r) {this->r = r;}
          void setG(int g) {this->g = g;}
          void setB(int b) {this->b = b;}
          int getR() {return r;}
          int getG() { return g;}
          int getB() {return b;}
          void setPrecisionFlag(bool flag) { precisionFlag = flag;}
          bool getPrecisionFlag() {return precisionFlag;}
          void setPrecision(int precision) {this->precision = precision;}
          int  getPrecision() {return precision;}
          friend Gout& operator<<(Gout& g, int int_val);
          friend Gout& operator<<(Gout& g, double int_val);
          friend Gout& operator<<(Gout& g, char* char_val);
          friend Gout& operator<<(Gout& g, string string_val);
         
      };
      
      extern Gout gout;
      
      struct Point
      {
        int x;
        int y;
      };
      
      
      
      struct GraphObject
      {
        char* str;
        int id;
        int no_points;
        Point* points;
        double* colors;
        int radius;
        int no_objects;
        BMPClass* bmp;
        int remove;
        int width;
        int height;
        int del;
        BYTE* bytes; //PNG BYTES
      };
      
      void reshape(int w, int h);
      void display(void);
      void init(char* title);
      int drawPoint(int x, int y);
      int drawCircle(int radius, int x, int y);
      void drawMyCircle( int Radius, int numPoints, int x, int y );
      int drawLine(int x1, int y1, int x2, int y2, int width);
      int drawRect(int x1, int y1, int width, int height);
      void displayGraphics();
      int displayBMP(char* fn,int x, int y);
      int displayBMP(string fn, int x, int y);
      int displayPNG(string fn, int x, int y);
      int displayPNG(char* fn, int x, int y);
      int displayText(char* str, int x, int y, int r, int g, int b);
      void clearGraphics();
      void setColor(int obj_no, int r, int g, int b);
      GraphColor setColor(int r, int g, int b);
      void timerColor(int value);
      void moveObject(int obj_no, int x, int y);
      void processSpecialKeys(int key, int x, int y);
      DWORD WINAPI display1(LPVOID lpParam);
      void processMouse(int button, int state, int x, int y);
      void removeObject(int id);
      void clearText();
      void GRAPH_SS();
      bool up();
      bool down();
      bool left();
      bool right();
      bool leftMouse(int&x, int&y);
      bool rightMouse(int&x, int&y);
      bool middleMouse(int&x, int&y);
      Gout& operator<<(Gout& g, int int_val);
      Gout& operator<<(Gout& g, double int_val);
      Gout& operator<<(Gout& g, char* char_val);
      Gout& operator<<(Gout& g, char char_val);
      Gout& operator<<(Gout& g, Gout&(*pt2Func)(int x, int y));
      Gout& operator<<(Gout& g, Gout&(*pt2Func)(int r, int g, int b));
      Gout& operator<<(Gout& g, Point a);
      Gout& operator<<(Gout& g, GraphColor gc);
      Gout& operator<<(Gout& g, Precision p);
      Gout& operator<<(Gout& g, Gout&(*pt2Func)(int precision));
      Precision setPrecision(int precision);
      Point setPos(int x, int y);
      void getPos(int obj_no, Point points[], int& no_points);
      bool mouseDragged(int& x, int& y);
      void processMouseDragged(int x, int y);
      void replaceObject(int orig_obj, int new_obj);
      void closeGraphics();
      
      #endif
      

      Right now I am of the opinion that it is a in-house "hackjob". That is how it feels with the GPLed BMPLoader glued together with other graphics functions. In an attempt to not have to use new literature or new style libraries with the new ".net 2008" style ide, as they were likely transitioning out of a codewarrior environment, and before that a borland environment.

      So far, I have asked our computer science club about it. The main thing I was told was that the professor just wants us to use windows. That I can understand, but I still want to see how far I can go. I have also tried sending an email about it to the professor, but all I got sent was a link to the glut downloads. I did reply back asking about the graphlib sources too, but I haven't heard anything back yet. I don't want to push too hard, I still have a whole semester ahead of me. So now I am asking here on tildes. I understand if nothing can be found, but at least information and experiences can be collected.

      11 votes
    2. Is the New Democratic Party a vassal for the Liberals in Canada if breaking from them is never on the table?

      If it's never even a remote consideration that the NDP may break from the Liberals and side with the CPC in the House of Commons, aren't they essentially a vassal for the LPC, soaking up votes...

      If it's never even a remote consideration that the NDP may break from the Liberals and side with the CPC in the House of Commons, aren't they essentially a vassal for the LPC, soaking up votes from disaffected Liberal voters and funneling them back into Liberal control? I mean from a simple game theoretic perspective, Liberals in the long run can demand everything and give nothing. I think Canadian politics has probably been damaged by overapplying the American left-right political spectrum, when it may be better thought as a three way spectrum between liberalism, conservatism, and democratic socialism (something like Red Toryism for example would be pretty inconceivable in American politics).

      14 votes
    3. Horror movies - let's talk creature features!

      Good morning, afternoon, and evening everyone! I hope everyone's doing well, or at least hanging in there this weekend. Now let's talk about horror movies that feature monsters or animals killing...

      Good morning, afternoon, and evening everyone! I hope everyone's doing well, or at least hanging in there this weekend. Now let's talk about horror movies that feature monsters or animals killing people in various fashions!

      Are you a fan of monsters from outer space, or a more grounded flick about an alligator terrorizing the sewers of 1980s NYC? What about man-made horrors beyond our comprehension? A dog that was having a bad day after being bitten by a rabid bat? Let your voice be heard in the comments below!


      I'll start with a movie the Sci-fi channel used to show every now and then (though it originally aired as a mini-series on ABC): The Beast, based off of Peter Benchley's novel of the same name. If the author sounds familiar, he wrote a book you may have heard of: Jaws.

      Featuring a giant squid terrorizing yet another idyllic New England town, The Beast isn't a very good movie when you get down to it, but it's an enjoyable watch nonetheless. It's essentially a 90s remake of Jaws with a giant squid instead of a shark, but it has a certain coziness and warmth to it that I enjoy. It's not even close to my favorite creature feature, but it was on my mind so I figured I'd let someone else talk about how awesome Lake Placid is. And this movie has Gil Grissom from CSI going up against a giant squid, so that's pretty neat.

      Anyway, it's the weekend, let's watch some horror movies!

      25 votes
    4. Fresh Album Fridays: Olivia Rodrigo, James Blake, The Chemical Brothers and more

      Good morning ~ This is a thread to discuss new album releases that have arrived on our doorstep this week. Feel free to share albums and EPs that have caught your eye and interest! Discussion...

      Good morning ~ This is a thread to discuss new album releases that have arrived on our doorstep this week. Feel free to share albums and EPs that have caught your eye and interest!

      Discussion Points

      What are you looking forward to listen to?
      Have you listened to any of these releases?
      What are your thoughts?
      What have you enjoyed from these artists in the past?

      Why Friday?

      Most (but not all) new LPs release on a Friday, as labels want to give the release a full week of sales before entering the charts.

      ~~ Feedback on the format welcome!

      14 votes
    5. What are the best resources for finding work in today's climate?

      I've been a professional in the IT sector for the past 25 years, and during that time I've gone through several different methods of finding my next gig. Back when I started out, the internet was...

      I've been a professional in the IT sector for the past 25 years, and during that time I've gone through several different methods of finding my next gig. Back when I started out, the internet was still a relatively new thing, so I got my first few positions by answering ads in the local newspaper (remember those?)

      Two years ago, I decided to try my hand at writing novels, and while that has been quite fulfilling personally, it hasn't yet started to pay any bills so I've had to keep my IT skills sharp and hold down a standard job to pay the bills.

      Now though, I find that I'm looking a lot harder at the companies and people I work for, and I'd like to be able to shop around a bit more for a position at a place that is more in line with me as a person.

      To that end, I'm wondering what methods are more commonplace now for finding employment, as opposed to my standard, which is pretty much indeed and the occasional linkedin find. Which methods have you had the most success with?

      22 votes
    6. What have you been watching / reading this month? (Anime/Manga)

      What have you been watching and reading this month? You don't need to give us a whole essay if you don't want to, but please write something! Feel free to talk about something you saw that was...

      What have you been watching and reading this month? You don't need to give us a whole essay if you don't want to, but please write something! Feel free to talk about something you saw that was cool, something that was bad, ask for recommendations, or anything else you can think of.

      If you want to, feel free to find the thing you're talking about and link to its pages on Anilist, MAL, or any other database you use!

      12 votes
    7. Do you replay video games?

      Now that Baldur's Gate 3 is releasing on PS5, I got to thinking about a pet peeve I have as a gamer: no matter how many choices and freedom a game gives me, I can hardly get myself to replay it...

      Now that Baldur's Gate 3 is releasing on PS5, I got to thinking about a pet peeve I have as a gamer: no matter how many choices and freedom a game gives me, I can hardly get myself to replay it after I finish it once.

      There are only ever a handful of exceptions - mostly when I want to show my partner some games I loved when growing up.

      The best example I have is Skyrim: I absolutely loved the game on launch date, and I was glued to my PC for several weeks. But after I finished it, I could never get back into it.

      I guess my question is less about games that are designed to be replayable (strategy, sims, management, multiplayer) and more about titles such as The Witcher, Grand Theft Auto, Red Ded Redemption, Metal Gear Solid, etc.

      So, do you replay such "replayable" titles? Why or why not?

      30 votes
    8. Offbeat Fridays – The thread where offbeat headlines become front page news

      Tildes is a very serious site, where we discuss very serious matters like misinformation, lightbulbs.led and pilots. Tags culled from the highest voted topics from the last seven days, if anyone...

      Tildes is a very serious site, where we discuss very serious matters like misinformation, lightbulbs.led and pilots. Tags culled from the highest voted topics from the last seven days, if anyone was interested.

      But one of my favourite tags happens to be offbeat! Taking its original inspiration from Sir Nils Olav III, this thread is looking for any far-fetched offbeat stories lurking in the newspapers. It may not deserve its own post, but it deserves a wider audience!

      6 votes