Welcome, Guest. Please login or register. Did you miss your activation email?

Show Posts

This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.


Messages - kipbits

Pages: 1 [2] 3 4
16
Graphics / [SOLVED]OpenGL Colored Cube Render Issue SFML 2.3.2
« on: August 13, 2016, 05:06:04 pm »
Hey all, I'm trying to get into some OpenGL with SFML, and am having some trouble with some example code for drawing a colored cube. I am still using 2.3.2 and was hoping to keep my current setup for a little while before updating to 2.4. I've read somewhere about some bugs with 2.3.2's OpenGL implementation. Is that an issue here or is there some dumb thing I'm missing in my code? Also I'm on mac; Could this be a mac problem?
here is my code:
#include <SFML/Audio.hpp>
#include <SFML/Graphics.hpp>
#include <SFML/Window.hpp>

#include <OpenGL/gl.h>
#include <OpenGL/glu.h>
#include <GLUT/glut.h>

int main(int, char const**)
{
    // Create the main window
    sf::RenderWindow window(sf::VideoMode(800, 600, 32), "SFML OpenGL");
     
    // Set color and depth clear value
    glClearDepth(1.f);
    glClearColor(0.f, 0.f, 0.f, 0.f);
   
    // Enable Z-buffer read and write
    glEnable(GL_DEPTH_TEST);
    glDepthMask(GL_TRUE);
    //glDepthFunc(GL_LESS);
   
    // Setup a perspective projection
    glMatrixMode(GL_PROJECTION);
    glLoadIdentity();
    //gluPerspective(90.f, 1.f, 1.f, 500.f);
    gluPerspective(70.f, 1.f, 1.f, 500.f);

    sf::Clock Clock;
   
    // Start the game loop
    while (window.isOpen())
    {
        // Process events
        sf::Event event;
        while (window.pollEvent(event))
        {
            // Close window: exit
            if (event.type == sf::Event::Closed) {
                window.close();
            }

            // Escape pressed: exit
            if (event.type == sf::Event::KeyPressed && event.key.code == sf::Keyboard::Escape) {
                window.close();
            }
           
            if (event.type == sf::Event::Resized)
                glViewport(0, 0, event.size.width, event.size.height);
        }
       
        // Clear screen
        window.clear();
       
        sf::Time myTime = Clock.getElapsedTime();
        float myftime = myTime.asSeconds();

        window.setActive();
       
        glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT);
       
        glMatrixMode(GL_MODELVIEW);
        glLoadIdentity();
        glTranslatef(0.f, 0.f, -200.f);
        glRotatef(myftime * 50, 1.f, 0.f, 0.f);
        glRotatef(myftime * 30, 0.f, 1.f, 0.f);
        glRotatef(myftime * 90, 0.f, 0.f, 1.f);
       
        glBegin(GL_QUADS);
       
        glColor3f(1.f, 0.f, 0.f);//red
        glVertex3f(-50.f, -50.f, -50.f);
        glVertex3f(-50.f,  50.f, -50.f);
        glVertex3f( 50.f,  50.f, -50.f);
        glVertex3f( 50.f, -50.f, -50.f);
       
        //glColor3f(1.f, 0.f, 0.f);//red
        glColor3f(0.f, 1.f, 1.f);//cyan
        glVertex3f(-50.f, -50.f, 50.f);
        glVertex3f(-50.f,  50.f, 50.f);
        glVertex3f( 50.f,  50.f, 50.f);
        glVertex3f( 50.f, -50.f, 50.f);
       
        glColor3f(0.f, 1.f, 0.f);//green
        glVertex3f(-50.f, -50.f, -50.f);
        glVertex3f(-50.f,  50.f, -50.f);
        glVertex3f(-50.f,  50.f,  50.f);
        glVertex3f(-50.f, -50.f,  50.f);
       
        //glColor3f(0.f, 1.f, 0.f);//green
        glColor3f(1.f, 0.f, 1.f);//magenta
        glVertex3f(50.f, -50.f, -50.f);
        glVertex3f(50.f,  50.f, -50.f);
        glVertex3f(50.f,  50.f,  50.f);
        glVertex3f(50.f, -50.f,  50.f);
       
        glColor3f(0.f, 0.f, 1.f);//blue
        glVertex3f(-50.f, -50.f,  50.f);
        glVertex3f(-50.f, -50.f, -50.f);
        glVertex3f( 50.f, -50.f, -50.f);
        glVertex3f( 50.f, -50.f,  50.f);
       
        //glColor3f(0.f, 0.f, 1.f);//blue
        glColor3f(1.f, 1.f, 0.f);//yellow
        glVertex3f(-50.f, 50.f,  50.f);
        glVertex3f(-50.f, 50.f, -50.f);
        glVertex3f( 50.f, 50.f, -50.f);
        glVertex3f( 50.f, 50.f,  50.f);
       
        glEnd();
       
        // Update the window
        window.display();
    }
   
    return EXIT_SUCCESS;
}
 

and here is a gif:

17
SFML projects / Re: [MAC]I published an SFML applet: ToneBoards
« on: August 01, 2016, 07:21:24 pm »
You are right Hapax! but I was more going for the beginnings of an accessiblilty item for the visually impared  ;) :P

I do have some standard a bunch of piano roll configs if thats more your style. I kindof like the Janko layouts though because you dont end up with any non-sounding-keys.

I'm glad someone seams to enjoy it.

18
SFML projects / Re: [MAC]I published an SFML applet: ToneBoards
« on: July 30, 2016, 02:51:58 pm »
Hey all, been awhile...
After neglecting ToneBoards for a couple months, I've decided to end my experiment. ToneBoards is free again. I've havent really had much free time this summer and have put a sequel on the backburner for the moment. A $ had a pretty strong effect on downloads, and I've decided I would rather have people download and enjoy ToneBoards. Hopefully I'll get some time in the next few months to work on a more fully functioned sequel.

Thanks all who downloaded!

again the link:
https://itunes.apple.com/us/app/toneboards/id1064364557

& demo vid:
https://www.youtube.com/watch?v=ow18FAKZVNI

19
SFML projects / Re: [MAC]I published an SFML applet: ToneBoards
« on: May 31, 2016, 01:57:25 am »
I generated a bunch of piano roll configs for those who want a more familiar layout.

I'm still conducting my experiment...

20
SFML projects / Re: [MAC]I published an SFML applet: ToneBoards
« on: May 23, 2016, 03:25:26 pm »
Well, downloads have exeded 500 copies in the first 2 weeks! Still working on a companion app, although it might be a few months before its release. This app will be more fully functioned, and geared towards composition rather than performance. I'm also planning to release the companion app as a paid app($$).
 
In the mean time, I'm thinking of bumping the price up to $1 as an expirement.

Also I'll try and release another video when i get some more time to practice...

21
SFML projects / Re: [MAC]I published an SFML applet: ToneBoards
« on: May 11, 2016, 03:34:54 pm »
So... it plays a sound on a key press with a pitch determined by the key?

I think it would be a good idea (if not just somewhat polite) if you were to put that really long list in that post above inside spoiler tags:
(click to show/hide)


Thanks Hapax!!!!

22
SFML projects / Re: [MAC]I published an SFML applet: ToneBoards
« on: May 10, 2016, 06:18:17 pm »
And there is some hidden sample code in with the CFG_zip, to help with procedurally generating new CFG's.

(doing it my hand would take some time).

23
SFML projects / Re: [MAC]I published an SFML applet: ToneBoards
« on: May 10, 2016, 05:51:43 pm »
I should probably include the description:
ToneBoards lets you turn your keyboard into a configurable & dynamic, chromatic-tone-generator. Choose from a selection of keyboard-tone-mappings, or create your own custom map. Configurations supports a range of 128 chromatic keys, and 255 microtonal key positions, from C-1 to G#9. Even numbers represent the Chromatic keys, while odds represent the inbetween microtonal keys. To create a new config, fill out the empty_template_cfg_.txt file in the app package, and save it with a new name in sConfigFiles folder.

Here's a link to some extra cfg files: http://www.kipplebits.net/toneboards/CFG_files.zip

(click to show/hide)

24
SFML projects / [MAC][Linux?]I published an SFML applet: ToneBoards
« on: May 09, 2016, 04:27:27 pm »
------------------------------------------------------------------------------
Update: Happy 2020!
------------------------------------------------------------------------------
I recently found some time, in 3.5 years since first publishing my app on the Mac Appstore, to fix the sound files for ToneBoards. For those interested, you can now download the new tones on github. Install by dragging and dropping the contents of the TONESv15 into your toneboards app package TONESv10 folder (sorry, I'm on limited time, and can't make it fancy).

...I still plan to port to linux(recently been playing with MX Linux) although stuff just keeps getting in the way. Anyway, I thought I'd share these before I forgot about them. These new sounds are designed to play better on small laptop speakers, especially the base notes! Maybe I'll provide an explanation of how I made them later...

Update the Update

I posted some demos along with my notes and code for the update

...still planning to port to linux some time. ....must find my lost code...

------------------------------------------------------------------------------
Update: Happy New Years 2018!
------------------------------------------------------------------------------
I decided to publish the source for ToneBoards. I just haven't had as much time to work on it as I would have liked this past year. Perhaps someone will find it useful. Also I'm kind of thinking about letting my Apple developer account lapse. It's just another expense for me right now, and was sort of a hassle to set up. I'm becoming more interested in other ways to assure users of quality/integrity of a piece of software. I've recently discovered a makeshift alternative to apple developer certificates(i think). I mean what is the point of code signing when you can just compare digests using openSSL?

Below are some Github links, and I'm also posting digests and filesizes. I think this should provide a way for users to gain 99% of the assurances provided by the Appstore(with a couple added steps on the user's part).

https://github.com/kipbits/ToneBoards/releases
xxd ToneBoards.app.zip
size(hex):0db4330

openssl dgst -sha512 ToneBoards.app.zip
SHA512(ToneBoards.app.zip)= ef8c3a1e54301c8a6ad0e53706e4e5e5c9f0fc85ee4d8d1aee6faf195801494a1b919b02be1de4455f005d04308270b8e8c3c06c254849a7a4c0b74ed6a2881c

https://github.com/kipbits/SFML-2.3.2-Updated-plist_altered-keyboard/releases
xxd Frameworks.tar.gz
size(hex):0367110

openssl dgst -sha512 Frameworks.tar.gz
SHA512(Frameworks.tar.gz)= 3524096384e6337b654a85286f91bebdd86534d0719e735f4e29b40687efb36d4de9add983d56a12c78cf2f58aba3876104f2f3b851d39dbb8df5131070448c9
------------------------------------------------------------------------------

I published an applet: https://itunes.apple.com/us/app/toneboards/id1064364557


I call it Toneboards: here is the info page
https://kipplebits.wordpress.com

and a video
https://youtu.be/ow18FAKZVNI


Someone with an international keybard please test this for functionality with non-US-English keyboards.

Thanks, and Enjoy

.
.
.
I'm still working on a more fully-functional, companion app which i will hopefully releas in a few months...for some minimal price.

25
g++ sfmltest2.cpp -I/usr/local/include -L/usr/local/lib -lsfml-audio -lsfml-window -lsfml-system

Well That seemed to fix it. Thanks!

Funny before updating to El Capitan I could run it without the extra flags:
      g++ sfmltest2.cpp -lsfml-audio -lsfml-window -lsfml-system

Any Idea what they did with the new OS X?

26
Hey all, I'm having some trouble compiling some sfml in the terminal. I have compiled and run sfml in the terminal before, although that was a few months ago, and before i upgraded to El Capitan. I still seem to be able to run Xcode projects just fine; It is nice thought to be able to run small test directly in the terminal.

I'm getting the following error:

     mycomputer:sfmltest me$ g++ sfmltest2.cpp -lsfml-system
     sfmltest2.cpp:1:10: fatal error: 'SFML/System.hpp' file not found
     #include <SFML/System.hpp>
              ^
     1 error generated.


I think i have SFML installed correctly:
  • lib is in usr/local/lib
  • include is in usr/local/include
  • the contents of frameworks and extlibs are in Library/Frameworks

I got info on g++

    mycomputer:sfmltest me$ g++ -v
    Configured with: --prefix=/Applications/Xcode.app/Contents/Developer/usr --with-gxx-include-dir=/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.11.sdk/usr/include/c++/4.2.1
    Apple LLVM version 7.0.2 (clang-700.1.81)
    Target: x86_64-apple-darwin15.2.0
    Thread model: posix

and my $PATH

    mycomputer:sfmltest me$ echo $PATH
    /Users/me/perl5/perlbrew/bin:/Users/me/perl5/perlbrew/perls/perl-5.16.0/bin:/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin:/opt/X11/bin


I noticed that my install location wasnt included. Is this a problem? what is the point of the compiler flags -lsfml-system / -framework sfml-system?

I've tried both dylibs and framworks now, and i get the same error. and I'm hoping to get some advice before i go and screw up my default paths.

Thanks,
kipbits

27
Window / sf::Joystick DualShock3 Sixaxis Analogue Triggers
« on: December 28, 2015, 01:06:38 am »
Hey all, Happy Holidays!
I'm playing around here with a Dualshock3 Sixaxis controller. I've gotten the basic info following Joystick API, but something does not look right.
Basically, I'm wondering does SFML recognize Dualshock's analogue R2 & L2 triggers?
SFML reports the connected controller as follows:

Joystick 0 is connected! PLAYSTATION(R)3 Controller vendor:1356 product:616
   J0 has X axis!
   J0 has Y axis!
   J0 has Z axis!
   J0 has R axis!
   J0 has 19 buttons
Joystick 1 is NOT connected!
Joystick 2 is NOT connected!
Joystick 3 is NOT connected!
Joystick 4 is NOT connected!
Joystick 5 is NOT connected!
Joystick 6 is NOT connected!
Joystick 7 is NOT connected!

I seam to have both thumbsticks and all the buttons, plus 3 that i havent been able to identify. I was kindof expecting to have minus 2 buttons, replaced by active U&V axes for the triggers. On Wikipedia, it says that Dualshock3 Sixaxis supports 2 analogue sticks and 2 analogue triggers.

I'm wondering if i can get the full functionality for those triggers in SFML?

Thanks

28
General / Re: Mac App Upload Error: ¿Code-Signing? ¿freetype?
« on: December 16, 2015, 04:52:27 am »
sure, I assume its the same for all of them. I'm actually still having some issues getting my App submitted, I'll have a look at it after I get this first problem fixed.

29
General / Re: Mac App Upload Error: ¿Code-Signing? ¿freetype?
« on: December 15, 2015, 09:06:19 pm »
I fixed it!
The problem was that I had only edited my project-info.plist. I went and added the same lines for to the info.plist's for freetype.frameworks and sndfile.framework.

  • CFBundleSupportedPlatforms => array,
  • item0 => MacOSX

Seems to have done the trick.



ON A SIDE NOTE: i'm now getting this warning that SFML is using a deprecated audio unit

WARNING:  140: This application, or a library it uses, is using the deprecated Carbon Component Manager for hosting Audio Units. Support for this will be removed in a future release. Also, this makes the host incompatible with version 3 audio units. Please transition to the API's in AudioComponent.h.

30
General / Re: Mac App Upload Error: ¿Code-Signing? ¿freetype?
« on: December 14, 2015, 08:09:22 pm »
it looks like some else had a similar problem.

although i don't really understand his solution.

Pages: 1 [2] 3 4
anything