
Source (link to git-repo or to original if based on someone elses unmodified work): Add the source-code for this project on opencode.net
An under water screen saver for KDE4
Thanks to John Stamp for your help.
todo:
sea creature swimming pattern
camera movement (swimming through seen)
How to Install:
1 install package build-essential cmake kdebase-workspace-dev libqt4-opengl-dev or your distros equivalent
2 download.
3 extract (tar -xzf "the file you downloaded")
4 change to the new directory (KOceanSaver)
5 cmake -DCMAKE_INSTALL_PREFIX:PATH=/usr CMakeLists.txt
6 sudo make install
And a big thanks to the guys and gals at mepis-deb.org for making the debian packages for all of us who use a debian distro.
If your distro is not (k)ubuntu then you may or may not need the -DCMAKE_INSTALL_PREFIX:PATH=/usr. a simple
1 cmake CMakeLists.txt
2 sudo make install
will work for you.
7 years ago
0.1, 0.2, 0.3
1 Faster skeleton animation function for fish. (this dropped CPU usage by half or more on my computer even with wave added. Matrix is only calculated once for each bone instead of once for each vertex)
2 Added ocean surface with waves. (Please let me know what you think)
3 Moved things around to make it more aesthetic
Please give feedback so I know if I'm going in the right direction
0.4
1. Changed time basted movement (much faster now)
2. Adding Setting Dialog.
3. Adding new fish
0.5
1 Changed form qmake to cmake.
0.6
1 Added rocking motion.
0.7
1. Bug fixes and performance improvements.
2. Added Orca.
3. Added new function for attached fish (remora).
0.8
1. Bug fixes (fish disapeare after screen suspend)
2 Added fish: Grouper.
7 years ago
0.1, 0.2, 0.3
1 Faster skeleton animation function for fish. (this dropped CPU usage by half or more on my computer even with wave added. Matrix is only calculated once for each bone instead of once for each vertex)
2 Added ocean surface with waves. (Please let me know what you think)
3 Moved things around to make it more aesthetic
Please give feedback so I know if I'm going in the right direction
0.4
1. Changed time basted movement (much faster now)
2. Adding Setting Dialog.
3. Adding new fish
0.5
1 Changed form qmake to cmake.
0.6
1 Added rocking motion.
0.7
1. Bug fixes and performance improvements.
2. Added Orca.
3. Added new function for attached fish (remora).
0.8
1. Bug fixes (fish disapeare after screen suspend)
2 Added fish: Grouper.
tittiatcoke
9 years ago
When building, I get the following build-error:
[ 55%] Building CXX object src/CMakeFiles/koceansaver.kss.dir/ocean.o
/home/hq000006/Downloads/KOceanSaver/src/ocean.cpp: In member function ‘virtual void Ocean::resizeGL(GLint, GLint)’:
/home/hq000006/Downloads/KOceanSaver/src/ocean.cpp:354:69: error: ‘gluPerspective’ was not declared in this scope
make[2]: *** [src/CMakeFiles/koceansaver.kss.dir/ocean.o] Error 1
make[1]: *** [src/CMakeFiles/koceansaver.kss.dir/all] Error 2
I am running openSUSE 12.1, with KDE 4.8 Beta and Qt 4.8 RC. I am not sure if the KDE or Qt versions got anything to do with the above, but it seems as if a certain include is missing.
Thanks
Raymond
Report
jboss1995
9 years ago
https://bugreports.qt.nokia.com/browse/QTSDK-1022
So just add
#include <GL/glu.h>
in ocean.cpp and it should work fine. I will make changes to source soon. Thanks.
Report
tittiatcoke
9 years ago
Thanks for the fast replies. Unfortunately I hadn't access to my computer last night, so I couldn't reply. Yes, KDE 4.8 is currently in Beta.
Fortunately including the statement #include <GL/glu.h> solved the issue.
Thanks
Raymond
Report
jboss1995
9 years ago
Report
jboss1995
9 years ago
https://bugreports.qt.nokia.com/browse/QTSDK-1022
So just add
#include <GL/glu.h>
in ocean.cpp and it should work fine. I will make changes to source soon. Thanks.
Report
jboss1995
9 years ago
Report
jboss1995
9 years ago
Report
tittiatcoke
9 years ago
But as indicated I guess that maybe Qt 4.8 doesn't include something that it did with version 4.7. That is why I was wondering if you would know which include should provide this missing variable ?
Regards
Raymond
Report
jboss1995
9 years ago
Report
jboss1995
9 years ago
1. changed it to cmake now (sould compile on any system now)
2. changed my time basted movement (much faster now)
3. Working on adding Setting Dialog.
4. Adding new fish (remora attaches itself to shark)
5. Adding new fish (Manta ray)
Hope to have thing done soon.
Report
CharlesT
9 years ago
qt4-3.1-amd on AMD64 and for some reason the screen now goes blank and uses up 100% of the cpu. I have dual cpus so one is always at 100% and the computer is almost completely useless until I close KOceanSaver.
What could be causing that?
Will upgrading to Natty 11.04 change that?
Report
jboss1995
9 years ago
Report
jboss1995
9 years ago
Report
jmiahman
10 years ago
terminate called after throwing an instance of 'std::bad_alloc'
what(): std::bad_alloc
Aborted
I'm running KDE 4.4.2
QT 4.6.2
and Unity Linux (a Mandriva derivative)
Report
jboss1995
10 years ago
Report
jmiahman
10 years ago
86
I have 86 files in:
/usr/share/kde4/apps/koceansaver/data/
is that correct?
Report
jboss1995
10 years ago
terminate called after throwing an instance of 'std::bad_alloc'
what(): std::bad_alloc
Aborted
I'm kinda new to programing for KDE may be that for different distro it need a different path. Can anyone else help or add anything that might help?
Report
jstamp
10 years ago
To fix it, I'd use cmake instead. Since that's what KDE standardized on, it'd be the best way to make sure that the screensaver uses the right paths, no matter which distribution you're building on.
Report
anjpr
10 years ago
Report
jboss1995
10 years ago
Report
ruxax
11 years ago
And are pictures from data/ocean/ directory unused at the moment?
Report
mx3208
11 years ago
like you say, i add package libqt4-opengl-dev, and all is fine
on debian sid x64
great work
Report
mx3208
11 years ago
i try to install it on two machine
the first fedora 11 x64
kstarndarddirs.h can't be found
------
make install
g++ -c -m64 -pipe -O2 -g -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fstack-protector --param=ssp-buffer-size=4 -m64 -mtune=generic -Wall -W -D_REENTRANT -DQT_NO_DEBUG -DQT_OPENGL_LIB -DQT_GUI_LIB -DQT_CORE_LIB -I/usr/lib64/qt4/mkspecs/linux-g++-64 -I. -I/usr/include/QtCore -I/usr/include/QtGui -I/usr/include/QtOpenGL -I/usr/include -I/usr/X11R6/include -I. -o ocean.o ocean.cpp
ocean.cpp:24:27: error: kstandarddirs.h: No such file or directory
ocean.cpp: In constructor ‘Ocean::Ocean(QWidget*)’:
ocean.cpp:113: error: ‘KStandardDirs’ has not been declared
ocean.cpp:119: error: ‘KStandardDirs’ has not been declared
ocean.cpp:125: error: ‘KStandardDirs’ has not been declared
ocean.cpp: In member function ‘unsigned int Ocean::LoadImageFile(const char*)’:
ocean.cpp:269: error: ‘KStandardDirs’ has not been declared
make: *** [ocean.o] Error 1
---------
locate kstandarddirs.h
/usr/include/kde/kstandarddirs.h
/usr/include/kde4/kstandarddirs.h
what's wrong
and the second installation is on a sidux (x64), i got same errors like ancleensen4
can you help me
Report
jboss1995
11 years ago
Report
ancleessen4
11 years ago
g++ -c -pipe -O2 -Wall -W -D_REENTRANT -DQT_NO_DEBUG -DQT_OPENGL_LIB -DQT_GUI_LIB -DQT_CORE_LIB -DQT_SHARED -I/usr/share/qt4/mkspecs/linux-g++ -I. -I/usr/include/qt4/QtCore -I/usr/include/qt4/QtGui -I/usr/include/qt4/QtOpenGL -I/usr/include/qt4 -I/usr/X11R6/include -I. -o ocean.o ocean.cpp
ocean.cpp:22:20: error: QtOpenGL: No such file or directory
In file included from ocean.cpp:26:
ocean.h:24:21: error: QGLWidget: No such file or directory
In file included from seacreature.h:23,
from ocean.h:26,
from ocean.cpp:26:
guidancesystem.h:31: error: expected class-name before ‘{’ token
In file included from ocean.h:27,
from ocean.cpp:26:
wavemap.h:26: error: expected class-name before ‘{’ token
In file included from ocean.cpp:26:
ocean.h:31: error: expected class-name before ‘{’ token
ocean.h: In member function ‘void Ocean::timerEvent(QTimerEvent*)’:
ocean.h:52: error: ‘updateGL’ was not declared in this scope
In file included from ocean.cpp:27:
ship.h: In function ‘void ship(unsigned int, unsigned int)’:
ship.h:24: error: ‘GL_TEXTURE_2D’ was not declared in this scope
ship.h:24: error: ‘glBindTexture’ was not declared in this scope
ship.h:25: error: ‘GL_QUADS’ was not declared in this scope
ship.h:25: error: ‘glBegin’ was not declared in this scope
ship.h:26: error: ‘glTexCoord2f’ was not declared in this scope
ship.h:26: error: ‘glNormal3f’ was not declared in this scope
ship.h:26: error: ‘glVertex3f’ was not declared in this scope
ship.h:164: error: ‘glEnd’ was not declared in this scope
ship.h:178: error: ‘GL_TRIANGLES’ was not declared in this scope
In file included from ocean.cpp:28:
floor.h: In function ‘void floor(unsigned int)’:
floor.h:3: error: ‘GL_TEXTURE_2D’ was not declared in this scope
floor.h:3: error: ‘glBindTexture’ was not declared in this scope
floor.h:4: error: ‘GL_QUADS’ was not declared in this scope
floor.h:4: error: ‘glBegin’ was not declared in this scope
floor.h:5: error: ‘glTexCoord2f’ was not declared in this scope
floor.h:5: error: ‘glNormal3f’ was not declared in this scope
floor.h:5: error: ‘glVertex3f’ was not declared in this scope
floor.h:1426: error: ‘glEnd’ was not declared in this scope
In file included from ocean.cpp:29:
rock.h: In function ‘void rock()’:
rock.h:22: error: ‘GL_QUADS’ was not declared in this scope
rock.h:22: error: ‘glBegin’ was not declared in this scope
rock.h:23: error: ‘glTexCoord2f’ was not declared in this scope
rock.h:23: error: ‘glNormal3f’ was not declared in this scope
rock.h:23: error: ‘glVertex3f’ was not declared in this scope
rock.h:887: error: ‘glEnd’ was not declared in this scope
In file included from ocean.cpp:30:
sky.h: In function ‘void sky()’:
sky.h:23: error: ‘GL_QUADS’ was not declared in this scope
sky.h:23: error: ‘glBegin’ was not declared in this scope
sky.h:24: error: ‘glNormal3f’ was not declared in this scope
sky.h:24: error: ‘glTexCoord2f’ was not declared in this scope
sky.h:24: error: ‘glVertex3f’ was not declared in this scope
sky.h:25: error: ‘glEnd’ was not declared in this scope
In file included from ocean.cpp:31:
chest.h: In function ‘void chest(unsigned int, unsigned int)’:
chest.h:23: error: ‘GL_TEXTURE_2D’ was not declared in this scope
chest.h:23: error: ‘glBindTexture’ was not declared in this scope
chest.h:24: error: ‘GL_QUADS’ was not declared in this scope
chest.h:24: error: ‘glBegin’ was not declared in this scope
chest.h:25: error: ‘glNormal3f’ was not declared in this scope
chest.h:25: error: ‘glTexCoord2f’ was not declared in this scope
chest.h:25: error: ‘glVertex3f’ was not declared in this scope
chest.h:53: error: ‘glEnd’ was not declared in this scope
chest.h:311: error: ‘GL_TRIANGLES’ was not declared in this scope
ocean.cpp: In constructor ‘Ocean::Ocean(QWidget*)’:
ocean.cpp:33: error: class ‘Ocean’ does not have any field named ‘QGLWidget’
ocean.cpp:33: error: ‘QGL’ has not been declared
ocean.cpp:33: error: ‘QGL’ has not been declared
ocean.cpp:33: error: ‘QGL’ has not been declared
ocean.cpp:33: error: ‘QGLFormat’ was not declared in this scope
ocean.cpp:35: error: ‘makeCurrent’ was not declared in this scope
ocean.cpp:36: error: ‘startTimer’ was not declared in this scope
ocean.cpp:110: error: ‘setWindowTitle’ was not declared in this scope
ocean.cpp: In destructor ‘Ocean::~Ocean()’:
ocean.cpp:144: error: ‘makeCurrent’ was not declared in this scope
ocean.cpp: In member function ‘void Ocean::initializeGL()’:
ocean.cpp:150: error: ‘GL_TEXTURE_2D’ was not declared in this scope
ocean.cpp:150: error: ‘glEnable’ was not declared in this scope
ocean.cpp:151: error: ‘GL_SMOOTH’ was not declared in this scope
ocean.cpp:151: error: ‘glShadeModel’ was not declared in this scope
ocean.cpp:152: error: ‘glClearColor’ was not declared in this scope
ocean.cpp:153: error: ‘glClearDepth’ was not declared in this scope
ocean.cpp:154: error: ‘GL_DEPTH_TEST’ was not declared in this scope
ocean.cpp:155: error: ‘GL_LEQUAL’ was not declared in this scope
ocean.cpp:155: error: ‘glDepthFunc’ was not declared in this scope
ocean.cpp:156: error: ‘GL_PERSPECTIVE_CORRECTION_HINT’ was not declared in this scope
ocean.cpp:156: error: ‘GL_NICEST’ was not declared in this scope
ocean.cpp:156: error: ‘glHint’ was not declared in this scope
ocean.cpp:158: error: ‘GL_LIGHT1’ was not declared in this scope
ocean.cpp:158: error: ‘GL_AMBIENT’ was not declared in this scope
ocean.cpp:158: error: ‘glLightfv’ was not declared in this scope
ocean.cpp:160: error: ‘GL_DIFFUSE’ was not declared in this scope
ocean.cpp:162: error: ‘GL_POSITION’ was not declared in this scope
ocean.cpp:164: error: ‘GL_LIGHTING’ was not declared in this scope
ocean.cpp:165: error: ‘GL_SRC_ALPHA’ was not declared in this scope
ocean.cpp:165: error: ‘GL_ONE_MINUS_SRC_ALPHA’ was not declared in this scope
ocean.cpp:165: error: ‘glBlendFunc’ was not declared in this scope
ocean.cpp:167: error: ‘GL_EXP’ was not declared in this scope
ocean.cpp:167: error: ‘GL_EXP2’ was not declared in this scope
ocean.cpp:167: error: ‘GL_LINEAR’ was not declared in this scope
ocean.cpp:168: error: ‘GL_FOG_MODE’ was not declared in this scope
ocean.cpp:168: error: ‘glFogi’ was not declared in this scope
ocean.cpp:170: error: ‘GL_FOG_COLOR’ was not declared in this scope
ocean.cpp:170: error: ‘glFogfv’ was not declared in this scope
ocean.cpp:171: error: ‘GL_FOG_DENSITY’ was not declared in this scope
ocean.cpp:171: error: ‘glFogf’ was not declared in this scope
ocean.cpp:172: error: ‘GL_FOG_HINT’ was not declared in this scope
ocean.cpp:172: error: ‘GL_DONT_CARE’ was not declared in this scope
ocean.cpp:173: error: ‘GL_FOG_START’ was not declared in this scope
ocean.cpp:174: error: ‘GL_FOG_END’ was not declared in this scope
ocean.cpp:175: error: ‘GL_FOG’ was not declared in this scope
ocean.cpp: In member function ‘void Ocean::paintGL()’:
ocean.cpp:181: error: ‘GL_COLOR_BUFFER_BIT’ was not declared in this scope
ocean.cpp:181: error: ‘GL_DEPTH_BUFFER_BIT’ was not declared in this scope
ocean.cpp:181: error: ‘glClear’ was not declared in this scope
ocean.cpp:182: error: ‘glLoadIdentity’ was not declared in this scope
ocean.cpp:190: error: ‘GL_BLEND’ was not declared in this scope
ocean.cpp:190: error: ‘glDisable’ was not declared in this scope
ocean.cpp:191: error: ‘GL_LIGHTING’ was not declared in this scope
ocean.cpp:191: error: ‘glEnable’ was not declared in this scope
ocean.cpp:192: error: ‘GL_TEXTURE_2D’ was not declared in this scope
ocean.cpp:192: error: ‘glBindTexture’ was not declared in this scope
ocean.cpp:194: error: ‘glTranslatef’ was not declared in this scope
ocean.cpp:195: error: ‘glRotatef’ was not declared in this scope
ocean.cpp:215: error: ‘glScalef’ was not declared in this scope
ocean.cpp:223: error: ‘glColor4f’ was not declared in this scope
ocean.cpp: In member function ‘void Ocean::resizeGL(int, int)’:
ocean.cpp:256: error: ‘glViewport’ was not declared in this scope
ocean.cpp:257: error: ‘GL_PROJECTION’ was not declared in this scope
ocean.cpp:257: error: ‘glMatrixMode’ was not declared in this scope
ocean.cpp:258: error: ‘glLoadIdentity’ was not declared in this scope
ocean.cpp:259: error: ‘gluPerspective’ was not declared in this scope
ocean.cpp:260: error: ‘GL_MODELVIEW’ was not declared in this scope
ocean.cpp: In member function ‘unsigned int Ocean::LoadImageFile(const char*)’:
ocean.cpp:271: error: ‘QGLWidget’ has not been declared
ocean.cpp:273: error: ‘glGenTextures’ was not declared in this scope
ocean.cpp:274: error: ‘GL_TEXTURE_2D’ was not declared in this scope
ocean.cpp:274: error: ‘glBindTexture’ was not declared in this scope
ocean.cpp:275: error: ‘GL_TEXTURE_MAG_FILTER’ was not declared in this scope
ocean.cpp:275: error: ‘GL_LINEAR’ was not declared in this scope
ocean.cpp:275: error: ‘glTexParameteri’ was not declared in this scope
ocean.cpp:276: error: ‘GL_TEXTURE_MIN_FILTER’ was not declared in this scope
ocean.cpp:277: error: ‘GL_RGBA8’ was not declared in this scope
ocean.cpp:277: error: ‘GL_RGBA’ was not declared in this scope
ocean.cpp:277: error: ‘GL_UNSIGNED_BYTE’ was not declared in this scope
ocean.cpp:277: error: ‘glTexImage2D’ was not declared in this scope
make: *** [ocean.o] Error 1
[email protected]:/home/neil/KOceanSaver#
Any help much appreciated.
Report