Java-Gaming.org Hi !
Featured games (81)
games approved by the League of Dukes
Games in Showcase (513)
Games in Android Showcase (119)
games submitted by our members
Games in WIP (576)
games currently in development
News: Read the Java Gaming Resources, or peek at the official Java tutorials
 
    Home     Help   Search   Login   Register   
Pages: [1]
  ignore  |  Print  
  opengl questions  (Read 997 times)
0 Members and 2 Guests are viewing this topic.
Offline starshiptroopers

Junior Newbie




Java games rock!


« Posted 2005-04-30 07:13:49 »

hi i am new to opengl ,
how do you create a (interactive)button in opengl java?
I am trying to have it so if the user clicks the button it creates a sphere or some type of object. I konw its basic but I am trying to get the hang of opengl

thanks ahead of time

Offline starshiptroopers

Junior Newbie




Java games rock!


« Reply #1 - Posted 2005-04-30 07:29:49 »

anyone?
Offline Deadcow

Senior Newbie




Back from beyond ... Moo!


« Reply #2 - Posted 2005-04-30 07:59:40 »

OpenGL is a really low level graphic api. There is no such things like "controls" or "buttons". It's more about drawing textured polygons, lines and points. So the short answer is NO. Still, you can create your own widgets ( see http://glow.sourceforge.net/ for an example ), but if you're new to OpenGL, it's probably too much of a challenge.
Games published by our own members! Check 'em out!
Legends of Yore - The Casual Retro Roguelike
Offline K.I.L.E.R

Senior Duke




Java games rock!


« Reply #3 - Posted 2005-04-30 10:22:55 »

Create an object, add dimensions and a renderer to it.

Add something to convert mouse click coords into OpenGL coords, or create your own viewport with integer coords.

Check every frame to see if the mouse coords are inside the object.

Works for me.

Vorax:
Is there a name for a "redneck" programmer?

Jeff:
Unemployed. Wink
Offline darkprophet

Senior Duke




Go Go Gadget Arms


« Reply #4 - Posted 2005-04-30 11:13:57 »

Its a little bit more complicated than that Killer...

In game, its like saying:

Open a window, render the player, if he shoots, kill the person in front of him. Move him around with the cursor keys. And when you get through that door, you finished the game Smiley

DP

Friends don't let friends make MMORPGs.

Blog | Volatile-Engine
Offline K.I.L.E.R

Senior Duke




Java games rock!


« Reply #5 - Posted 2005-04-30 13:12:47 »

Implementing it code wise isn't difficult.
Effectively you will need layers and your GUI would be the top layer and you have to render everything in order and you can check your clicks by the z-order of objects.

Yeh it is a little bit more complicated than I made it out to be, but the idea is pretty simple and if you understand OpenGL's basics it isn't all that difficult to implement a button.

Implementing text is probably going to give him a larger headache than anything.


Quote
Its a little bit more complicated than that Killer...

In game, its like saying:

Open a window, render the player, if he shoots, kill the person in front of him. Move him around with the cursor keys. And when you get through that door, you finished the game Smiley

DP


Vorax:
Is there a name for a "redneck" programmer?

Jeff:
Unemployed. Wink
Pages: [1]
  ignore  |  Print  
 
 
You cannot reply to this message, because it is very, very old.

 

Add your game by posting it in the WIP section,
or publish it in Showcase.

The first screenshot will be displayed as a thumbnail.

Longarmx (46 views)
2014-10-17 03:59:02

Norakomi (37 views)
2014-10-16 15:22:06

Norakomi (29 views)
2014-10-16 15:20:20

lcass (32 views)
2014-10-15 16:18:58

TehJavaDev (62 views)
2014-10-14 00:39:48

TehJavaDev (62 views)
2014-10-14 00:35:47

TehJavaDev (52 views)
2014-10-14 00:32:37

BurntPizza (70 views)
2014-10-11 23:24:42

BurntPizza (40 views)
2014-10-11 23:10:45

BurntPizza (82 views)
2014-10-11 22:30:10
Understanding relations between setOrigin, setScale and setPosition in libGdx
by mbabuskov
2014-10-09 22:35:00

Definite guide to supporting multiple device resolutions on Android (2014)
by mbabuskov
2014-10-02 22:36:02

List of Learning Resources
by Longor1996
2014-08-16 10:40:00

List of Learning Resources
by SilverTiger
2014-08-05 19:33:27

Resources for WIP games
by CogWheelz
2014-08-01 16:20:17

Resources for WIP games
by CogWheelz
2014-08-01 16:19:50

List of Learning Resources
by SilverTiger
2014-07-31 16:29:50

List of Learning Resources
by SilverTiger
2014-07-31 16:26:06
java-gaming.org is not responsible for the content posted by its members, including references to external websites, and other references that may or may not have a relation with our primarily gaming and game production oriented community. inquiries and complaints can be sent via email to the info‑account of the company managing the website of java‑gaming.org
Powered by MySQL Powered by PHP Powered by SMF 1.1.18 | SMF © 2013, Simple Machines | Managed by Enhanced Four Valid XHTML 1.0! Valid CSS!