GUI Programming Alex Feldmeier.

Slides:



Advertisements
Similar presentations
Event handling and listeners What is an event? user actions and context event sources and listeners Why should my programs be event- driven? User interaction.
Advertisements

Windows Test Review.
CS7026 jQuery Events. What are Events?  jQuery is tailor-made to respond to events in an HTML page.  Events are actions that can be detected by your.
1 Computer Graphics Chapter 2 Input Devices. RM[2]-2 Input Devices Logical Input Devices  Categorized based on functional characteristics.  Each device.
Microsoft® Small Basic
C HAPTER 12 A Very Graphic Story. O VERVIEW Simple GUI Getting User Input Creating a Listener ActionEvents Displaying Graphics Drawing Multiple Buttons.
A graphical user interface (GUI) is a pictorial interface to a program. A good GUI can make programs easier to use by providing them with a consistent.
Event Driven Programming and GUIs Part 3 CS221 – 4/15/09.
Event Handling. In this class we will cover: Basics of event handling The AWT event hierarchy Semantic and low-level events in the AWT.
1 Model View Controller. 2 Outline Review Definitions of MVC Why do we need it? Administiriva Changing the display Event flow Dragging at interactive.
Graphical User Interface (GUI) Nelson Padua-Perez Bill Pugh Department of Computer Science University of Maryland, College Park.
How to Debug VB .NET Code.
Graphical User Interface (GUI) Nelson Padua-Perez Chau-Wen Tseng Department of Computer Science University of Maryland, College Park.
0 CS 160: Design Process: Implement Event-based UI Programming, Model-View-Controller, and the Web Jeffrey Nichols IBM Almaden Research Center
Sketchify Tutorial Graphics and Animation in Sketchify sketchify.sf.net Željko Obrenović
Chapter 1- Visual Basic Schneider 1 Chapter 1 An Introduction to Computers and Visual Basic.
Stanford hci group / cs376 research topics in human-computer interaction UI Software Tools Scott Klemmer 27 October 2005.
Java Swing - Lecture 1 An Introduction Milena Radenkovic slides originally by Chris Coleman.
Scratch the Cat. Object Oriented Programing Writing computer programs Based on Objects Instead of Actions Based on Data Instead of Logic.
14 Chapter 11: Designing the User Interface. 14 Systems Analysis and Design in a Changing World, 3rd Edition 2 Identifying and Classifying Inputs and.
David Streader Computer Science Victoria University of Wellington Copyright: David Streader, Victoria University of Wellington GUI and the UI API COMP.
Java Programming, 3e Concepts and Techniques Chapter 3 Section 65 – Manipulating Data Using Methods – Java Applet.
Welcome to CIS 083 ! Events CIS 068.
Department of Mechanical Engineering, LSUSession VII MATLAB Tutorials Session VIII Graphical User Interface using MATLAB Rajeev Madazhy
Event Driven Programming
Introduction to OpenGL and GLUT GLUT. What is OpenGL? An application programming interface (API) A (low-level) Graphics rendering API Generate high-quality.
Lecture 5: Interaction 1  Principles of Interactive Graphics  CMSCD2012  Dr David England, Room 711,  ex 2271 
Ex3 Preview, Swing tutorial Ex1 review Amit Shabtay.
Liang, Introduction to Java Programming, Eighth Edition, (c) 2011 Pearson Education, Inc. All rights reserved Event Driven Programming, The.
Lab 6: event & input intro User Interface Lab: GUI Lab Oct. 2 nd, 2013.
CHAPTER TWO INTRODUCTION TO VISUAL BASIC © Prepared By: Razif Razali 1.
Lecture 11: Exam Revision 1  Principles of Interactive Graphics  CMSCD2012  Dr David England, Room 718,  ex 2271  Coursework.
Window and Events The structure of Interactive Software.
XNA An Introduction. What XNA is… Microsoft® XNA™ is composed of industry- leading software, services, resources, and communities focused on enabling.
User Interface Interface: web room planner. User Interface Inspiration: Google SketchUp.
Model View Controller A Pattern that Many People Think They Understand, But Has A Couple Meanings.
1 Creating Windows GUIs with Visual Studio. 2 Creating the Project New Project Visual C++ Projects Windows Forms Application Give the Project a Name and.
Java Applets: GUI Components, Events, Etc. Ralph Westfall June, 2010.
CS324e - Elements of Graphics and Visualization Java GUIs - Event Handling.
Introduction to OpenGL and GLUT. What’s OpenGL? An Application Programming Interface (API) A low-level graphics programming API – Contains over 250 functions.
UID – Event Handling and Listeners Boriana Koleva
Object Oriented Programming.  Interface  Event Handling.
11 General Game Programming Approach. The program is event-driven The program is event-driven –Messages = events –So as all windows system (for example.
Computer Graphics: Programming, Problem Solving, and Visual Communication Steve Cunningham California State University Stanislaus and Grinnell College.
Windows 2000 Unit A A1 – A24 and Ap1 – Ap3 (Formatting a Disk)
 objects in Client  What is Event?  Event Handlers  programming.
1 Lecture 8: User Interface Components with Swing.
CIS 338: Events Dr. Ralph D. Westfall April, 2011.
12-Jun-16 Event loops. 2 Programming in prehistoric times Earliest programs were all “batch” processing There was no interaction with the user Input Output.
Creating a Simple Game in Scratch Barb Ericson Georgia Tech May 2009.
Mobile Computing CSE 40814/60814 Spring 2017.
A look ahead: At the end of your project, you’ll be given an opportunity to make a standalone (.exe) version of your project. For this to work, you’ll.
Scratch for Interactivity
Event Loops and GUI Intro2CS – weeks
Introduction to Computer CC111
Event loops 16-Jun-18.
An Introduction to Computers and Visual Basic
Lesson 1: Buttons and Events – 12/18
Event Driven Programming
Event loops.
Event loops 17-Jan-19.
Event loops 17-Jan-19.
An Introduction to Computers and Visual Basic
Event loops 8-Apr-19.
Model, View, Controller design pattern
Event loops.
Event loops.
Event loops 19-Aug-19.
TA: Nouf Al-Harbi NoufNaief.net :::
Presentation transcript:

GUI Programming Alex Feldmeier

Concepts Create GUI from scratch OpenGL has no built in GUI Developers create new GUI for every game

What you have Mouse location Mouse button up/down Keyboard key events Ability to draw images

Layout Managers Scalable to more complex projects Resizable to resolutions and aspect ratios Standardized format (XML) Drag and drop controls

XML Standardized format Easier to edit Easier to read Less code

Component Overlap Which draws on top Which handles events Should you clip

Clipping Used for windows Need to clip both image and boundaries Can be hard clipping rotated component (Unity)

Types Retained mode Immediate mode Contains GUI state Rendered when needed

Retained mode (pros) Industry standard for years More object oriented Central control Good for looping back Ex: dragging Only renders when updating

Retained mode (cons) Lots of callbacks Harder for changing components Uses separate place for 2D and 3D

Immediate mode (pros) All GUI code in 1 place Build into pre-existing rendering code Easier to add widget to screen Redraws whole screen every time (can be con) Good for games If component not needed, don’t draw it

Immediate mode (cons) Hard for program to traverse GUI 1 frame of lag GUI doesn’t control everything 1 frame of lag Needs watchers at end of renderer to check what happened Ex: dragging Code is decentralized

Event Handling (Retained Mode) Event class Component activated EventListener interface handleEvent(Event e); User-side function to perform event (ex: button click)

Component States (Immediate Mode) Active Mouse click Hot Mouse hover Focus Used for keyboard input

Active Mouse click Ex: button pressed Maintains state until mouse release Only hot item can be active

Hot Mouse hover Ex: button highlights Loses state when mouse exits Only obtainable if (one of the following) It is active Nothing else is active

Focus Takes keyboard input Acts like active but does not lock hot

References Adams, Ernest, and Andrew Rollings. Fundamentals of Game Design. Berkeley, CA: New Riders, 2010. Print. Astle, Dave, and Kevin Hawkins. Beginning OpenGL Game Programming. Boston, MA: Thomson/Course Technology, 2004. Print. Eckstein, Robert, Marc Loy, and Dave Wood. Java Swing. Sebastopol, CA: O'Reilly, 1998. Print. Harrington, Jan L. Object-oriented C Data Structures for Real Programmers. San Diego: Morgan Kaufmann, 2002. Print. Thorn, Alan. "Game Engine Design and Implementation." Game Engine Design and Implementation. Jones & Bartlett Learning, n.d. Web. 13 Oct. 2013. Other sources: http://mollyrocket.com http://mollyrocket.com/861 http://johno.se/book/index.html http://sol.gfxile.net/imgui/